fix process reap in the join API

This commit is contained in:
Nikita Smith
2026-06-02 12:10:01 -07:00
committed by Ryan Fleury
parent 55172718c9
commit 846b2bdf70
+4 -7
View File
@@ -1285,15 +1285,12 @@ process_join(Process process, U64 endt_us, U64 *exit_code_out)
B32 result = 0; B32 result = 0;
if(endt_us == 0) if(endt_us == 0)
{ {
if(kill(pid, 0) >= 0) if(kill(pid, 0) == 0)
{ {
result = (errno == ENOENT); int status;
if(result) waitpid(pid, &status, WNOHANG);
{
int status;
waitpid(pid, &status, 0);
}
} }
else { Assert(0 && "failed to get status from pid"); }
} }
else if(endt_us == max_U64) else if(endt_us == max_U64)
{ {