From 76107ba3af9cfddd62dc3f9dfab45bcf93d10f9e Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Wed, 2 Aug 1995 02:55:47 +0000 Subject: [PATCH] Don't set TS_ZOMBIE flag for non-open ptys. ptcclose() has always done too much for non-open ptys, but there is normally no problem because the l_modem(, 0) is a no-op for closed ptys provided the line discipline is standard and MDMBUF isn't set. --- sys/kern/tty_pty.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c index 178082dd0f9b..9bbb0035daf9 100644 --- a/sys/kern/tty_pty.c +++ b/sys/kern/tty_pty.c @@ -31,7 +31,7 @@ * SUCH DAMAGE. * * @(#)tty_pty.c 8.2 (Berkeley) 9/23/93 - * $Id: tty_pty.c,v 1.15 1995/07/22 16:45:08 bde Exp $ + * $Id: tty_pty.c,v 1.16 1995/07/31 21:01:25 bde Exp $ */ /* @@ -312,9 +312,11 @@ ptcclose(dev) * sense for ptys. Recover by doing everything that a normal * ttymodem() would have done except for sending a SIGHUP. */ - tp->t_state &= ~(TS_CARR_ON | TS_CONNECTED); - tp->t_state |= TS_ZOMBIE; - ttyflush(tp, FREAD | FWRITE); + if (tp->t_state & TS_ISOPEN) { + tp->t_state &= ~(TS_CARR_ON | TS_CONNECTED); + tp->t_state |= TS_ZOMBIE; + ttyflush(tp, FREAD | FWRITE); + } tp->t_oproc = 0; /* mark closed */ tp->t_session = 0;