Supervisor reaps all children, not just one, before starting new child.

git-svn-id: http://yate.null.ro/svn/yate/trunk@1424 acf43c95-373e-0410-b603-e72c3f656dc1
This commit is contained in:
paulc 2007-08-15 12:28:57 +00:00
parent b9dd361c2c
commit 657da65c74
1 changed files with 2 additions and 1 deletions

View File

@ -386,7 +386,8 @@ static int supervise(void)
::fcntl(logfd[0],F_SETFL,O_NONBLOCK);
}
// reap any children we may have before spawning a new one
::waitpid(-1,0,WNOHANG);
while (::waitpid(-1,0,WNOHANG) > 0)
;
s_childpid = ::fork();
if (s_childpid < 0) {
int err = errno;