When flushing output we don't care whether we are the foreground

process or not, we still need to flush to /dev/tty.  If we are in
the background, it is OK to get SIGTTOU.
This commit is contained in:
Todd C. Miller
2013-10-24 10:19:36 -06:00
parent 38a5b0a655
commit a090d0678c

View File

@@ -926,8 +926,7 @@ del_io_events(void)
} }
} }
/* Flush any write buffers with data in them. */ /* Flush any write buffers with data in them. */
if (iob->wevent != NULL && if (iob->wevent != NULL) {
(foreground || !USERTTY_EVENT(iob->wevent))) {
if (iob->len > iob->off) { if (iob->len > iob->off) {
if (sudo_ev_add(evbase, iob->wevent, false) == -1) if (sudo_ev_add(evbase, iob->wevent, false) == -1)
fatal(_("unable to add event to queue")); fatal(_("unable to add event to queue"));