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:
Mikolaj Golub 2012-06-04 09:22:22 +00:00
parent 9fa69148a3
commit c60d51f964
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=236550

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;