diff --git a/lib/wasix/src/syscalls/wasix/proc_join.rs b/lib/wasix/src/syscalls/wasix/proc_join.rs index 262ff139f6b..aa18a92adfa 100644 --- a/lib/wasix/src/syscalls/wasix/proc_join.rs +++ b/lib/wasix/src/syscalls/wasix/proc_join.rs @@ -189,22 +189,23 @@ pub(super) fn proc_join_internal( } else { ret_result(ctx, JoinStatusResult::Nothing) }; - } - else { + } else { // Wait for the process to finish let process2 = process.clone(); - let res = - __asyncify_with_deep_sleep::(ctx, Duration::from_millis(50), async move { + let res = __asyncify_with_deep_sleep::( + ctx, + Duration::from_millis(50), + async move { let exit_code = process.join().await.unwrap_or_else(|_| Errno::Child.into()); tracing::trace!(%exit_code, "triggered child join"); JoinStatusResult::ExitNormal(pid, exit_code) - })?; + }, + )?; return match res { AsyncifyAction::Finish(ctx, result) => ret_result(ctx, result), AsyncifyAction::Unwind => Ok(Errno::Success), }; } - } trace!(ret_id = pid.raw(), "status=nothing");