From bb1140a9a54d550c9eb7ba6d26c513e1c9c8ed0b Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Tue, 31 Oct 1995 19:27:50 +0000 Subject: [PATCH] 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. --- sys/kern/tty.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/kern/tty.c b/sys/kern/tty.c index de2da4675132..d9c24e8a0ef4 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;