1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 18:57:36 +00:00

Get rid of the undertaker and have waitpid() be the reaper.

For dead orphans, the scheduler calls reap().
This commit is contained in:
Andreas Kling 2018-11-07 23:59:49 +01:00
parent f792349853
commit 1dbc340da8
6 changed files with 45 additions and 60 deletions

View file

@ -248,7 +248,14 @@ static int runcmd(char* cmd)
}
int wstatus = 0;
waitpid(child, &wstatus, 0);
int rc;
do {
rc = waitpid(child, &wstatus, 0);
if (rc < 0 && errno != EINTR) {
perror("waitpid");
break;
}
} while(errno == EINTR);
// FIXME: Should I really have to tcsetpgrp() after my child has exited?
// Is the terminal controlling pgrp really still the PGID of the dead process?