diff options
author | ache <ache@FreeBSD.org> | 1995-02-28 23:21:33 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1995-02-28 23:21:33 +0000 |
commit | e33e8dd4a86cd33fe28b83d7b83ac323d854106d (patch) | |
tree | c376a3f03eee0290d6e281188b37fa7c97afe120 /sys/kern/tty.c | |
parent | 8bcefcd5f8f192f2fb67a89ce624ada3fc1ea920 (diff) | |
download | FreeBSD-src-e33e8dd4a86cd33fe28b83d7b83ac323d854106d.zip FreeBSD-src-e33e8dd4a86cd33fe28b83d7b83ac323d854106d.tar.gz |
Workaround IXOFF bug when output queue is full && RTS control is on
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r-- | sys/kern/tty.c | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c index 2020d7d..9edf66a 100644 --- a/sys/kern/tty.c +++ b/sys/kern/tty.c @@ -36,7 +36,7 @@ * SUCH DAMAGE. * * @(#)tty.c 8.8 (Berkeley) 1/21/94 - * $Id: tty.c,v 1.33 1995/02/27 19:47:31 ugen Exp $ + * $Id: tty.c,v 1.34 1995/02/28 00:21:03 pst Exp $ */ #include "snp.h" @@ -1098,12 +1098,16 @@ ttyflush(tp, rw) } if ((rw & FREAD) && ISSET(tp->t_state, TS_TBLOCK) && tp->t_rawq.c_cc < TTYHOG/5) { + int queue_full = 0; + if (ISSET(tp->t_iflag, IXOFF) && tp->t_cc[VSTART] != _POSIX_VDISABLE && - putc(tp->t_cc[VSTART], &tp->t_outq) == 0 || + (queue_full = putc(tp->t_cc[VSTART], &tp->t_outq)) == 0 || ISSET(tp->t_cflag, CRTS_IFLOW)) { CLR(tp->t_state, TS_TBLOCK); ttstart(tp); + if (queue_full) /* try again */ + SET(tp->t_state, TS_TBLOCK); } } splx(s); @@ -1137,12 +1141,16 @@ ttyblock(tp) if (total >= TTYHOG / 2 && !ISSET(tp->t_state, TS_TBLOCK) && (!ISSET(tp->t_lflag, ICANON) || tp->t_canq.c_cc > 0)) { + int queue_full = 0; + if (ISSET(tp->t_iflag, IXOFF) && tp->t_cc[VSTOP] != _POSIX_VDISABLE && - putc(tp->t_cc[VSTOP], &tp->t_outq) == 0 || + (queue_full = putc(tp->t_cc[VSTOP], &tp->t_outq)) == 0 || ISSET(tp->t_cflag, CRTS_IFLOW)) { SET(tp->t_state, TS_TBLOCK); ttstart(tp); + if (queue_full) /* try again */ + CLR(tp->t_state, TS_TBLOCK); } } } @@ -1531,12 +1539,16 @@ read: */ s = spltty(); if (ISSET(tp->t_state, TS_TBLOCK) && tp->t_rawq.c_cc < TTYHOG/5) { + int queue_full = 0; + if (ISSET(tp->t_iflag, IXOFF) && cc[VSTART] != _POSIX_VDISABLE && - putc(cc[VSTART], &tp->t_outq) == 0 || + (queue_full = putc(cc[VSTART], &tp->t_outq)) == 0 || ISSET(tp->t_cflag, CRTS_IFLOW)) { CLR(tp->t_state, TS_TBLOCK); ttstart(tp); + if (queue_full) /* try again */ + SET(tp->t_state, TS_TBLOCK); } } splx(s); |