summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWilliam Orr <will@worrbase.com>2017-11-05 22:40:57 -0800
committerWilliam Orr <will@worrbase.com>2017-11-11 10:44:10 -0800
commitecd0954394ce56829ad7ea2969b4ce031ab6eade (patch)
tree35ba4c4f8536816ab21832451e63e05a5a54d4d5
parente43d7db9bf1b9c9522aa00d0e7c3cc9f6feea237 (diff)
downloadnix-ecd0954394ce56829ad7ea2969b4ce031ab6eade.zip
Formatting with rustfmt
-rw-r--r--src/sys/wait.rs14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/sys/wait.rs b/src/sys/wait.rs
index 29822c02..019b751f 100644
--- a/src/sys/wait.rs
+++ b/src/sys/wait.rs
@@ -95,7 +95,7 @@ pub enum WaitStatus {
/// child process. This is only returned if `WaitPidFlag::WNOHANG`
/// was used (otherwise `wait()` or `waitpid()` would block until
/// there was something to report).
- StillAlive
+ StillAlive,
}
impl WaitStatus {
@@ -161,7 +161,7 @@ fn continued(status: i32) -> bool {
unsafe { libc::WIFCONTINUED(status) }
}
-fn decode(pid : Pid, status: i32) -> WaitStatus {
+fn decode(pid: Pid, status: i32) -> WaitStatus {
if exited(status) {
WaitStatus::Exited(pid, exit_status(status))
} else if signaled(status) {
@@ -199,10 +199,16 @@ pub fn waitpid<P: Into<Option<Pid>>>(pid: P, options: Option<WaitPidFlag>) -> Re
let option_bits = match options {
Some(bits) => bits.bits(),
- None => 0
+ None => 0,
};
- let res = unsafe { libc::waitpid(pid.into().unwrap_or(Pid::from_raw(-1)).into(), &mut status as *mut c_int, option_bits) };
+ let res = unsafe {
+ libc::waitpid(
+ pid.into().unwrap_or(Pid::from_raw(-1)).into(),
+ &mut status as *mut c_int,
+ option_bits,
+ )
+ };
Ok(match try!(Errno::result(res)) {
0 => StillAlive,