Move stdout/err flush into sys

This commit is contained in:
Jeremy Soller
2016-11-28 18:25:47 -07:00
parent 2ec21327f2
commit 1d0bba8224
4 changed files with 25 additions and 9 deletions

View File

@@ -81,16 +81,10 @@ impl Read for StdinRaw {
}
impl Write for StdoutRaw {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> { self.0.write(buf) }
#[cfg(not(target_os = "redox"))]
fn flush(&mut self) -> io::Result<()> { Ok(()) }
#[cfg(target_os = "redox")]
fn flush(&mut self) -> io::Result<()> { self.0.flush() }
}
impl Write for StderrRaw {
fn write(&mut self, buf: &[u8]) -> io::Result<usize> { self.0.write(buf) }
#[cfg(not(target_os = "redox"))]
fn flush(&mut self) -> io::Result<()> { Ok(()) }
#[cfg(target_os = "redox")]
fn flush(&mut self) -> io::Result<()> { self.0.flush() }
}