Skip to content

Commit

Permalink
Formatting with rustfmt
Browse files Browse the repository at this point in the history
  • Loading branch information
worr committed Nov 6, 2017
1 parent 73f9877 commit 29472a3
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions src/sys/wait.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,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 {
Expand Down Expand Up @@ -149,7 +149,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) {
Expand Down Expand Up @@ -187,10 +187,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,
Expand Down

0 comments on commit 29472a3

Please sign in to comment.