[core] Add loop with waitpid to avoid zombies process

This commit is contained in:
Alexis Lina 2022-06-01 13:42:24 +02:00
parent 7f0edeafcc
commit be73c096d0

View File

@ -41,8 +41,12 @@
static void handle_SIGCHLD(int sig)
{
int status = 0;
int pid = 0;
do {
pid = waitpid(-1, &status, WNOHANG);
} while (pid > 0);
wait(&status);
return;
}