diff options
| author | bors <bors@rust-lang.org> | 2017-02-08 18:11:06 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-02-08 18:11:06 +0000 |
| commit | 4379e2fa08bf31125efa1a9d8bc3c85b16e2c2f3 (patch) | |
| tree | 58de9050e9127eb919f6f11cb93bd951b457b644 /src/libstd/process.rs | |
| parent | 10f6a5c4431e09d355a0ba319a630e02a1e38361 (diff) | |
| parent | 62d22678d4a7c6a34837137073d8767166d6db1e (diff) | |
| download | rust-4379e2fa08bf31125efa1a9d8bc3c85b16e2c2f3.tar.gz rust-4379e2fa08bf31125efa1a9d8bc3c85b16e2c2f3.zip | |
Auto merge of #39645 - frewsxcv:rollup, r=frewsxcv
Rollup of 11 pull requests - Successful merges: #39462, #39512, #39529, #39557, #39561, #39582, #39583, #39597, #39622, #39624, #39630 - Failed merges:
Diffstat (limited to 'src/libstd/process.rs')
| -rw-r--r-- | src/libstd/process.rs | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/libstd/process.rs b/src/libstd/process.rs index c16b97ebda5..4ff35738b50 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -844,9 +844,9 @@ impl Child { /// guaranteed to repeatedly return a successful exit status so long as the /// child has already exited. /// - /// If the child has exited, then `Ok(status)` is returned. If the exit - /// status is not available at this time then an error is returned with the - /// error kind `WouldBlock`. If an error occurs, then that error is returned. + /// If the child has exited, then `Ok(Some(status))` is returned. If the + /// exit status is not available at this time then `Ok(None)` is returned. + /// If an error occurs, then that error is returned. /// /// Note that unlike `wait`, this function will not attempt to drop stdin. /// @@ -857,14 +857,13 @@ impl Child { /// ```no_run /// #![feature(process_try_wait)] /// - /// use std::io; /// use std::process::Command; /// /// let mut child = Command::new("ls").spawn().unwrap(); /// /// match child.try_wait() { - /// Ok(status) => println!("exited with: {}", status), - /// Err(ref e) if e.kind() == io::ErrorKind::WouldBlock => { + /// Ok(Some(status)) => println!("exited with: {}", status), + /// Ok(None) => { /// println!("status not ready yet, let's really wait"); /// let res = child.wait(); /// println!("result: {:?}", res); @@ -873,8 +872,8 @@ impl Child { /// } /// ``` #[unstable(feature = "process_try_wait", issue = "38903")] - pub fn try_wait(&mut self) -> io::Result<ExitStatus> { - self.handle.try_wait().map(ExitStatus) + pub fn try_wait(&mut self) -> io::Result<Option<ExitStatus>> { + Ok(self.handle.try_wait()?.map(ExitStatus)) } /// Simultaneously waits for the child to exit and collect all remaining |
