summaryrefslogtreecommitdiff
path: root/logging.c
diff options
context:
space:
mode:
authorTodd C. Miller <Todd.Miller@courtesan.com>1998-05-19 03:31:51 +0000
committerTodd C. Miller <Todd.Miller@courtesan.com>1998-05-19 03:31:51 +0000
commit233588d442d23a499af3fe383ca500ffc0cd7604 (patch)
tree118bb93a78b97abcc749ec86a39b725998f9c8d1 /logging.c
parentfc74eb9d17501af25469eb42f23f81a018abe411 (diff)
downloadsudo-233588d442d23a499af3fe383ca500ffc0cd7604.tar.gz
used waitpid or wait3 if we have 'em
Diffstat (limited to 'logging.c')
-rw-r--r--logging.c8
1 files changed, 7 insertions, 1 deletions
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 */