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:
dg 1994-08-01 10:42:26 +00:00
parent 8b75418fcc
commit 4470f3d596

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;