From 846b2bdf70bf9e10f35d3778c2923ee44dc37b97 Mon Sep 17 00:00:00 2001 From: Nikita Smith Date: Tue, 5 May 2026 14:34:43 -0700 Subject: [PATCH] fix process reap in the join API --- src/linux/base/linux_base.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/linux/base/linux_base.c b/src/linux/base/linux_base.c index cf764611..0152d64c 100644 --- a/src/linux/base/linux_base.c +++ b/src/linux/base/linux_base.c @@ -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) + if(kill(pid, 0) == 0) { - result = (errno == ENOENT); - if(result) - { - int status; - waitpid(pid, &status, 0); - } + int status; + waitpid(pid, &status, WNOHANG); } + else { Assert(0 && "failed to get status from pid"); } } else if(endt_us == max_U64) {