From: Todd C. Miller Date: Tue, 19 May 1998 03:31:51 +0000 (+0000) Subject: used waitpid or wait3 if we have 'em X-Git-Tag: SUDO_1_5_6~55 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=df4b885d1b99a849a29c52466d42f3e1d500d52f;p=sudo used waitpid or wait3 if we have 'em --- diff --git a/logging.c b/logging.c index f9967f09e..2725556a7 100644 --- a/logging.c +++ b/logging.c @@ -536,9 +536,15 @@ static void send_mail() static RETSIGTYPE reapchild(sig) int sig; { - int save_errno = errno; + int pid, status, save_errno = errno; +#ifdef sudo_waitpid + do { + pid = sudo_waitpid(-1, &status, WNOHANG); + } while (pid == -1); +#else (void) wait(NULL); +#endif #ifndef POSIX_SIGNALS (void) signal(SIGCHLD, reapchild); #endif /* POSIX_SIGNALS */