diff options
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/tty.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c index ed5724d..fd3c051 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -1531,8 +1531,10 @@ ovhiwat: 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; |