Fix boolean thinko in SIGCHLD reaper and call reapchild after sending
mail instead of doing a conditional sudo_waitpid.
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user