Fix boolean thinko in SIGCHLD reaper and call reapchild after sending

mail instead of doing a conditional sudo_waitpid.
This commit is contained in:
Todd C. Miller
2003-03-20 02:04:32 +00:00
parent 2897c23e9e
commit a7d746af2d

View File

@@ -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);