1
0
mirror of https://github.com/openbsd/src.git synced 2024-12-22 16:42:56 -08:00

syslogd leaves zombies around if multiple |/pathto/mylogprog

children died in a row.
Do waitpid(2) in a loop until there's nothing left.
OK henning@, millert@
This commit is contained in:
mpf 2008-03-16 15:44:18 +00:00
parent dbf4f69d7b
commit 14aef417a7

View File

@ -1,4 +1,4 @@
/* $OpenBSD: privsep.c,v 1.30 2007/03/15 05:18:32 djm Exp $ */
/* $OpenBSD: privsep.c,v 1.31 2008/03/16 15:44:18 mpf Exp $ */
/*
* Copyright (c) 2003 Anil Madhavapeddy <anil@recoil.org>
@ -753,11 +753,9 @@ sig_got_chld(int sig)
do {
pid = waitpid(WAIT_ANY, NULL, WNOHANG);
} while (pid == -1 && errno == EINTR);
if (pid == child_pid &&
cur_state < STATE_QUIT)
cur_state = STATE_QUIT;
if (pid == child_pid && cur_state < STATE_QUIT)
cur_state = STATE_QUIT;
} while (pid > 0 || (pid == -1 && errno == EINTR));
}
/* Read all data or return 1 for error. */