On a child exit, call waitpid(2) to clean up the process table.
Submitted by: Andrey Zonov <andrey zonov.org> MFC after: 1 week
This commit is contained in:
parent
d15be0fc1f
commit
1300b8151a
@ -217,6 +217,10 @@ wait_child(pid_t pid, sigset_t *mask)
|
||||
}
|
||||
switch (signo) {
|
||||
case SIGCHLD:
|
||||
if (waitpid(pid, NULL, WNOHANG) == -1) {
|
||||
warn("waitpid");
|
||||
return (-1);
|
||||
}
|
||||
return (terminate);
|
||||
case SIGTERM:
|
||||
terminate = 1;
|
||||
|
Loading…
Reference in New Issue
Block a user