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:
trociny 2012-06-04 09:22:22 +00:00
parent d15be0fc1f
commit 1300b8151a

View File

@ -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;