diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2014-01-29 16:33:57 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2014-02-03 09:32:33 -0800 |
| commit | ece8a8f520697be50cbe543bebe065c5198dae4d (patch) | |
| tree | fa1bf049d3b5d781c8c56e0d0491a655ece485a2 /src/libstd/io/process.rs | |
| parent | be4fc638092bf896c5c6c0672136b83b71e491ee (diff) | |
| download | rust-ece8a8f520697be50cbe543bebe065c5198dae4d.tar.gz rust-ece8a8f520697be50cbe543bebe065c5198dae4d.zip | |
std: Remove io::io_error
* All I/O now returns IoResult<T> = Result<T, IoError> * All formatting traits now return fmt::Result = IoResult<()> * The if_ok!() macro was added to libstd
Diffstat (limited to 'src/libstd/io/process.rs')
| -rw-r--r-- | src/libstd/io/process.rs | 15 |
1 files changed, 5 insertions, 10 deletions
diff --git a/src/libstd/io/process.rs b/src/libstd/io/process.rs index 6a10f24916f..62f6b3c3029 100644 --- a/src/libstd/io/process.rs +++ b/src/libstd/io/process.rs @@ -14,7 +14,7 @@ use prelude::*; use libc; use io; -use io::io_error; +use io::IoResult; use rt::rtio::{RtioProcess, IoFactory, LocalIo}; use fmt; @@ -93,7 +93,7 @@ pub enum ProcessExit { impl fmt::Show for ProcessExit { /// Format a ProcessExit enum, to nicely present the information. - fn fmt(obj: &ProcessExit, f: &mut fmt::Formatter) { + fn fmt(obj: &ProcessExit, f: &mut fmt::Formatter) -> fmt::Result { match *obj { ExitStatus(code) => write!(f.buf, "exit code: {}", code), ExitSignal(code) => write!(f.buf, "signal: {}", code), @@ -118,7 +118,7 @@ impl ProcessExit { impl Process { /// Creates a new pipe initialized, but not bound to any particular /// source/destination - pub fn new(config: ProcessConfig) -> Option<Process> { + pub fn new(config: ProcessConfig) -> IoResult<Process> { let mut config = Some(config); LocalIo::maybe_raise(|io| { io.spawn(config.take_unwrap()).map(|(p, io)| { @@ -142,13 +142,8 @@ impl Process { /// function. /// /// If the signal delivery fails, then the `io_error` condition is raised on - pub fn signal(&mut self, signal: int) { - match self.handle.kill(signal) { - Ok(()) => {} - Err(err) => { - io_error::cond.raise(err) - } - } + pub fn signal(&mut self, signal: int) -> IoResult<()> { + self.handle.kill(signal) } /// Wait for the child to exit completely, returning the status that it |
