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
+3 -6
View File
@@ -1285,15 +1285,12 @@ process_join(Process process, U64 endt_us, U64 *exit_code_out)
B32 result = 0;
if(endt_us == 0)
{
if(kill(pid, 0) >= 0)
{
result = (errno == ENOENT);
if(result)
if(kill(pid, 0) == 0)
{
int status;
waitpid(pid, &status, 0);
}
waitpid(pid, &status, WNOHANG);
}
else { Assert(0 && "failed to get status from pid"); }
}
else if(endt_us == max_U64)
{