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:
Juli Mallett 2003-06-13 07:37:45 +00:00
parent 815e414e17
commit 004bd28e40
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=116287

View file

@ -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) {