Skip to content

Commit

Permalink
review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
marmistrz committed Aug 8, 2017
1 parent 6881624 commit 729bdc7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
([#672](https://github.com/nix-rust/nix/pull/672))
- Added protocol families in `AddressFamily` enum.
([#647](https://github.com/nix-rust/nix/pull/647))
- Added a convenience method `.pid()` to the `enum WaitStatus`
- Added the `pid()` method to `WaitStatus` for extracting the PID.
([#722](https://github.com/nix-rust/nix/pull/722))

### Changed
Expand Down
18 changes: 9 additions & 9 deletions src/sys/wait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,20 +94,20 @@ pub enum WaitStatus {
}

impl WaitStatus {
/// Extracts the PID from the WaitStatus if the status is not StillAlive.
/// Extracts the PID from the WaitStatus unless it equals StillAlive.
pub fn pid(&self) -> Option<Pid> {
use self::WaitStatus::*;
match self {
&Exited(p, _) => Some(p),
&Signaled(p, _, _) => Some(p),
&Stopped(p, _) => Some(p),
&Continued(p) => Some(p),
&StillAlive => None,
match *self {
Exited(p, _) => Some(p),
Signaled(p, _, _) => Some(p),
Stopped(p, _) => Some(p),
Continued(p) => Some(p),
StillAlive => None,

#[cfg(any(target_os = "linux", target_os = "android"))]
&PtraceEvent(p, _, _) => Some(p),
PtraceEvent(p, _, _) => Some(p),
#[cfg(any(target_os = "linux", target_os = "android"))]
&PtraceSyscall(p) => Some(p),
PtraceSyscall(p) => Some(p),
}
}
}
Expand Down

0 comments on commit 729bdc7

Please sign in to comment.