Skip to content

Commit

Permalink
Apply review suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
g-bartoszek authored and theduke committed Sep 6, 2023
1 parent 66494e7 commit f4eaecd
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/wasix/src/syscalls/wasix/proc_join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -182,13 +182,13 @@ pub(super) fn proc_join_internal<M: MemorySize + 'static>(
}
));

if flags & JoinFlags::NON_BLOCKING != JoinFlags::from_bits_preserve(0) {
return if let Some(status) = process.try_join() {
if flags.contains(JoinFlags::NON_BLOCKING) {
if let Some(status) = process.try_join() {
let exit_code = status.unwrap_or_else(|_| Errno::Child.into());
ret_result(ctx, JoinStatusResult::ExitNormal(pid, exit_code))
} else {
ret_result(ctx, JoinStatusResult::Nothing)
};
}
} else {
// Wait for the process to finish
let process2 = process.clone();
Expand All @@ -201,13 +201,13 @@ pub(super) fn proc_join_internal<M: MemorySize + 'static>(
JoinStatusResult::ExitNormal(pid, exit_code)
},
)?;
return match res {
match res {
AsyncifyAction::Finish(ctx, result) => ret_result(ctx, result),
AsyncifyAction::Unwind => Ok(Errno::Success),
};
}
}
} else {
trace!(ret_id = pid.raw(), "status=nothing");
ret_result(ctx, JoinStatusResult::Nothing)
}

trace!(ret_id = pid.raw(), "status=nothing");
ret_result(ctx, JoinStatusResult::Nothing)
}

0 comments on commit f4eaecd

Please sign in to comment.