From 4470f3d596cc20c7dc9a20846eecabe7d58f4a0b Mon Sep 17 00:00:00 2001 From: dg Date: Mon, 1 Aug 1994 10:42:26 +0000 Subject: [PATCH] Allow for output processing routine to handle entire character buffer and thus not require a sleep/wakeup. Reviewed by: Submitted by: --- sys/kern/tty.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index ed5724d77e00..fd3c051a50c1 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;