summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-10-31 19:27:50 +0000
committerbde <bde@FreeBSD.org>1995-10-31 19:27:50 +0000
commit208ab1ba2e922692b29a4991febbe2c141c3233d (patch)
tree0d38a0054f195304229e43099f038af41c0170a2
parent8ba1da98f9cb498997b1deba65ec76d40273cb71 (diff)
downloadFreeBSD-src-208ab1ba2e922692b29a4991febbe2c141c3233d.zip
FreeBSD-src-208ab1ba2e922692b29a4991febbe2c141c3233d.tar.gz
Fixed initialization of TS_CONNECTED bit in t_state. It wasn't
set in open() when CLOCAL is set unless carrier is present. Fixed initialization of line discipline. It lived across opens. Lines that started with the wrong discipline probably didn't work at all, because TS_ISOPEN is only set by TTYDISC.
-rw-r--r--sys/kern/tty.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/tty.c b/sys/kern/tty.c
index de2da46..d9c24e8 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.69 1995/08/02 06:55:34 ache Exp $
+ * $Id: tty.c,v 1.70 1995/09/10 11:48:13 bde Exp $
*/
/*-
@@ -205,6 +205,8 @@ ttyopen(device, tp)
tp->t_dev = device;
if (!ISSET(tp->t_state, TS_ISOPEN)) {
SET(tp->t_state, TS_ISOPEN);
+ if (ISSET(tp->t_cflag, CLOCAL))
+ SET(tp->t_state, TS_CONNECTED);
bzero(&tp->t_winsize, sizeof(tp->t_winsize));
}
@@ -249,6 +251,7 @@ ttyclose(tp)
#endif
tp->t_gen++;
+ tp->t_line = TTYDISC;
tp->t_pgrp = NULL;
tp->t_session = NULL;
tp->t_state = 0;
OpenPOWER on IntegriCloud