summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1995-08-02 02:55:47 +0000
committerbde <bde@FreeBSD.org>1995-08-02 02:55:47 +0000
commit3be0ba285f8dfff33ab10a4bdcbca121a6107028 (patch)
tree5784258e27a64fd8cf750287fd8cd8e7c1af46f4 /sys
parent6b1a8632f74c57df9cbe5d4737ee9325ef2beeaa (diff)
downloadFreeBSD-src-3be0ba285f8dfff33ab10a4bdcbca121a6107028.zip
FreeBSD-src-3be0ba285f8dfff33ab10a4bdcbca121a6107028.tar.gz
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.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/tty_pty.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 178082d..9bbb003 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;
OpenPOWER on IntegriCloud