1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-27 07:33:16 +00:00

Don't call wait twice when closing or gcing.

This commit is contained in:
Calvin Rose 2021-11-27 09:05:43 -06:00
parent 6172a9ca2d
commit 3df7921fdc

View File

@ -485,8 +485,10 @@ static int janet_proc_gc(void *p, size_t s) {
/* Kill and wait to prevent zombies */ /* Kill and wait to prevent zombies */
kill(proc->pid, SIGKILL); kill(proc->pid, SIGKILL);
int status; int status;
if (!(proc->flags & JANET_PROC_WAITING)) {
waitpid(proc->pid, &status, 0); waitpid(proc->pid, &status, 0);
} }
}
#endif #endif
return 0; return 0;
} }