Allow for output processing routine to handle entire character buffer

and thus not require a sleep/wakeup.
Reviewed by:
Submitted by:
This commit is contained in:
David Greenman 1994-08-01 10:42:26 +00:00
parent a445481c3e
commit 9b970c5afa

View File

@ -1531,8 +1531,10 @@ ttwrite(tp, uio, flag)
uio->uio_resid += cc;
return (uio->uio_resid == cnt ? EWOULDBLOCK : 0);
}
SET(tp->t_state, TS_ASLEEP);
error = ttysleep(tp, &tp->t_outq, TTOPRI | PCATCH, ttyout, 0);
if (tp->t_outq.c_cc || ISSET(tp->t_state, TS_BUSY)) {
SET(tp->t_state, TS_ASLEEP);
error = ttysleep(tp, &tp->t_outq, TTOPRI | PCATCH, ttyout, 0);
}
splx(s);
if (error)
goto out;