diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2003-03-20 02:06:59 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2003-03-20 02:06:59 +0000 |
commit | a510012f46e7e5d69a42d86f9aab95753a849da6 (patch) | |
tree | 815e4ffd4e2f96b7360605fd8844195e67cc6818 | |
parent | 9fd75591d406eda4f14481509732f94aef3398a1 (diff) |
Fix boolean thinko in SIGCHLD reaper and call reapchild after sending
mail instead of doing a conditional sudo_waitpid.
-rw-r--r-- | usr.bin/sudo/logging.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/usr.bin/sudo/logging.c b/usr.bin/sudo/logging.c index 3a09ac58a7f..085a178c634 100644 --- a/usr.bin/sudo/logging.c +++ b/usr.bin/sudo/logging.c @@ -65,7 +65,7 @@ #include "sudo.h" #ifndef lint -static const char rcsid[] = "$Sudo: logging.c,v 1.157 2003/03/15 20:31:02 millert Exp $"; +static const char rcsid[] = "$Sudo: logging.c,v 1.158 2003/03/20 02:04:32 millert Exp $"; #endif /* lint */ static void do_syslog __P((int, char *)); @@ -547,10 +547,8 @@ send_mail(line) get_timestr(), user_name, line); fclose(mail); - /* If mailer is done, wait for it now. If not reapchild will get it. */ -#ifdef sudo_waitpid - (void) sudo_waitpid(pid, &status, WNOHANG); -#endif + /* If mailer is done, wait for it now. If not, we'll get it later. */ + reapchild(SIGCHLD); (void) sigprocmask(SIG_SETMASK, &oset, NULL); } @@ -592,7 +590,7 @@ reapchild(sig) int status, serrno = errno; #ifdef sudo_waitpid - while (sudo_waitpid(-1, &status, WNOHANG) != -1 && errno == EINTR) + while (sudo_waitpid(-1, &status, WNOHANG) != -1 || errno == EINTR) ; #else (void) wait(&status); |