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);
|
get_timestr(), user_name, line);
|
||||||
fclose(mail);
|
fclose(mail);
|
||||||
|
|
||||||
/* If mailer is done, wait for it now. If not reapchild will get it. */
|
/* If mailer is done, wait for it now. If not, we'll get it later. */
|
||||||
#ifdef sudo_waitpid
|
reapchild(SIGCHLD);
|
||||||
(void) sudo_waitpid(pid, &status, WNOHANG);
|
|
||||||
#endif
|
|
||||||
(void) sigprocmask(SIG_SETMASK, &oset, NULL);
|
(void) sigprocmask(SIG_SETMASK, &oset, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -592,7 +590,7 @@ reapchild(sig)
|
|||||||
int status, serrno = errno;
|
int status, serrno = errno;
|
||||||
|
|
||||||
#ifdef sudo_waitpid
|
#ifdef sudo_waitpid
|
||||||
while (sudo_waitpid(-1, &status, WNOHANG) != -1 && errno == EINTR)
|
while (sudo_waitpid(-1, &status, WNOHANG) != -1 || errno == EINTR)
|
||||||
;
|
;
|
||||||
#else
|
#else
|
||||||
(void) wait(&status);
|
(void) wait(&status);
|
||||||
|
Reference in New Issue
Block a user