]> granicus.if.org Git - sudo/commitdiff
used waitpid or wait3 if we have 'em
authorTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 19 May 1998 03:31:51 +0000 (03:31 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Tue, 19 May 1998 03:31:51 +0000 (03:31 +0000)
logging.c

index f9967f09ef51b719b5db7ead63e61a09f2766a60..2725556a7acafd9af3236357152481bbdfb0b217 100644 (file)
--- 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 */