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.
This commit is contained in:
Bruce Evans 1995-08-02 02:55:47 +00:00
parent bbfd33649d
commit 76107ba3af
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=9850

View File

@ -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;