]> granicus.if.org Git - sudo/commitdiff
save errno from being clobbered by wait(). From Theo
authorTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 6 Aug 1997 18:58:06 +0000 (18:58 +0000)
committerTodd C. Miller <Todd.Miller@courtesan.com>
Wed, 6 Aug 1997 18:58:06 +0000 (18:58 +0000)
logging.c

index b3eeced5dc302ce65ac4968d226659dd1123597c..e2311eb1932d7ed99e0be7995d2be1f2dd227b15 100644 (file)
--- a/logging.c
+++ b/logging.c
@@ -536,10 +536,13 @@ static void send_mail()
 static RETSIGTYPE reapchild(sig)
     int sig;
 {
+    int save_errno = errno;
+
     (void) wait(NULL);
 #ifndef POSIX_SIGNALS
     (void) signal(SIGCHLD, reapchild);
 #endif /* POSIX_SIGNALS */
+    errno = save_errno;
 }