1
0
mirror of https://github.com/janet-lang/janet synced 2024-06-15 18:00:01 +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,7 +485,9 @@ static int janet_proc_gc(void *p, size_t s) {
/* Kill and wait to prevent zombies */
kill(proc->pid, SIGKILL);
int status;
waitpid(proc->pid, &status, 0);
if (!(proc->flags & JANET_PROC_WAITING)) {
waitpid(proc->pid, &status, 0);
}
}
#endif
return 0;