summaryrefslogtreecommitdiff
path: root/sys/kern/tty.c
diff options
context:
space:
mode:
authorBruce Evans <bde@FreeBSD.org>1995-07-30 13:52:56 +0000
committerBruce Evans <bde@FreeBSD.org>1995-07-30 13:52:56 +0000
commit79ccb9aff376fa2289b0b077dcf83549828f84af (patch)
treee7ef4e61f3042d1d18773a3a7c586cfd4f6932e9 /sys/kern/tty.c
parent5eae614b135b037f3521c0a9a103549456c80fe9 (diff)
Notes
Diffstat (limited to 'sys/kern/tty.c')
-rw-r--r--sys/kern/tty.c37
1 files changed, 23 insertions, 14 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index 0df978656393..66947ae85ad5 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.58 1995/07/29 13:35:33 bde Exp $
+ * $Id: tty.c,v 1.59 1995/07/30 12:39:16 bde Exp $
*/
/*-
@@ -840,21 +840,30 @@ ttioctl(tp, cmd, data, flag)
}
ttsetwater(tp);
}
- if (cmd != TIOCSETAF) {
- if (ISSET(t->c_lflag, ICANON) !=
- ISSET(tp->t_lflag, ICANON))
- if (ISSET(t->c_lflag, ICANON)) {
- SET(tp->t_lflag, PENDIN);
- ttwakeup(tp);
- } else {
- struct clist tq;
-
+ if (ISSET(t->c_lflag, ICANON) != ISSET(tp->t_lflag, ICANON) &&
+ cmd != TIOCSETAF) {
+ if (ISSET(t->c_lflag, ICANON))
+ SET(tp->t_lflag, PENDIN);
+ else {
+ /*
+ * XXX we really shouldn't allow toggling
+ * ICANON while we're in a non-termios line
+ * discipline. Now we have to worry about
+ * panicing for a null queue.
+ */
+ if (tp->t_canq.c_cbreserved > 0 &&
+ tp->t_rawq.c_cbreserved > 0) {
catq(&tp->t_rawq, &tp->t_canq);
- tq = tp->t_rawq;
- tp->t_rawq = tp->t_canq;
- tp->t_canq = tq;
- CLR(tp->t_lflag, PENDIN);
+ /*
+ * XXX the queue limits may be
+ * different, so the old queue
+ * swapping method no longer works.
+ */
+ catq(&tp->t_canq, &tp->t_rawq);
}
+ CLR(tp->t_lflag, PENDIN);
+ }
+ ttwakeup(tp);
}
tp->t_iflag = t->c_iflag;
tp->t_oflag = t->c_oflag;