Use waitpid, instead of wait3, which is more portable.
Submitted by: "Todd C. Miller" <Todd.Miller@courtesan.com> Obtained from: OpenBSD Reviewed by: tjr
This commit is contained in:
parent
815e414e17
commit
004bd28e40
@ -543,8 +543,8 @@ waitchildren(const char *name, int waitall)
|
||||
pid_t pid;
|
||||
int status;
|
||||
|
||||
while ((pid = wait3(&status, !waitall && curprocs < maxprocs ?
|
||||
WNOHANG : 0, NULL)) > 0) {
|
||||
while ((pid = waitpid(-1, &status, !waitall && curprocs < maxprocs ?
|
||||
WNOHANG : 0)) > 0) {
|
||||
curprocs--;
|
||||
/* If we couldn't invoke the utility, exit. */
|
||||
if (childerr != 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user