From: Todd C. Miller Date: Wed, 6 Aug 1997 18:58:06 +0000 (+0000) Subject: save errno from being clobbered by wait(). From Theo X-Git-Tag: SUDO_1_5_4~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b5f54d7740ec83266905896d7f3fb9ad80ed0e7b;p=sudo save errno from being clobbered by wait(). From Theo --- diff --git a/logging.c b/logging.c index b3eeced5d..e2311eb19 100644 --- 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; }