No more pause on tty output in case of clist overflow.

This commit is contained in:
Serge Vakulenko
2015-01-20 18:09:13 -08:00
parent 8e228dde62
commit d8269d1996

View File

@@ -1568,10 +1568,19 @@ loop:
if (ce == 0) { if (ce == 0) {
tp->t_rocount = 0; tp->t_rocount = 0;
if (ttyoutput(*cp, tp) >= 0) { if (ttyoutput(*cp, tp) >= 0) {
/* no c-lists, wait a bit */ overflow: /* out of c-lists */
ttstart(tp); s = spltty();
sleep((caddr_t)&lbolt, TTOPRI); ttstart(tp);
goto loop; if (flag & IO_NDELAY) {
splx(s);
uio->uio_resid += cc;
return (uio->uio_resid == cnt ?
EWOULDBLOCK : 0);
}
tp->t_state |= TS_ASLEEP;
sleep((caddr_t)&tp->t_outq, TTOPRI);
splx(s);
goto loop;
} }
cp++, cc--; cp++, cc--;
if (tp->t_flags & FLUSHO || if (tp->t_flags & FLUSHO ||
@@ -1597,10 +1606,8 @@ loop:
tk_nout += ce; tk_nout += ce;
#endif #endif
if (i > 0) { if (i > 0) {
/* out of c-lists, wait a bit */ /* out of c-lists */
ttstart(tp); goto overflow;
sleep((caddr_t)&lbolt, TTOPRI);
goto loop;
} }
if (tp->t_flags & FLUSHO || tp->t_outq.c_cc > hiwat) if (tp->t_flags & FLUSHO || tp->t_outq.c_cc > hiwat)
break; break;