diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-08-04 19:26:26 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1997-08-04 19:26:26 +0000 |
commit | 73d7e506331c4d94cf190afc8e971bfcaa8fcfee (patch) | |
tree | 2d7924022671484045c1371140b2db29a2a98ae8 /gnu | |
parent | fb89d0cbe5641bec1cbdcc4473fbccfe84b2f3ed (diff) |
save errno in sigchld handlers
Diffstat (limited to 'gnu')
-rw-r--r-- | gnu/usr.bin/cvs/src/server.c | 3 | ||||
-rw-r--r-- | gnu/usr.bin/sudo/sudo/logging.c | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/gnu/usr.bin/cvs/src/server.c b/gnu/usr.bin/cvs/src/server.c index ea40a4c8901..98c7a76e69d 100644 --- a/gnu/usr.bin/cvs/src/server.c +++ b/gnu/usr.bin/cvs/src/server.c @@ -3852,9 +3852,12 @@ static void wait_sig (sig) int sig; { int status; + int save_errno = errno; + pid_t r = wait (&status); if (r == command_pid) command_pid_is_dead++; + errno = save_errno; } #endif diff --git a/gnu/usr.bin/sudo/sudo/logging.c b/gnu/usr.bin/sudo/sudo/logging.c index 0feb8d9cccc..03592f194db 100644 --- a/gnu/usr.bin/sudo/sudo/logging.c +++ b/gnu/usr.bin/sudo/sudo/logging.c @@ -37,7 +37,7 @@ */ #ifndef lint -static char rcsid[] = "$Id: logging.c,v 1.2 1996/11/17 16:34:00 millert Exp $"; +static char rcsid[] = "$Id: logging.c,v 1.3 1997/08/04 19:24:52 deraadt Exp $"; #endif /* lint */ #include "config.h" @@ -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; } |