Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Sep 1995 04:22:29 +1000
From:      Bruce Evans <bde@zeta.org.au>
To:        freebsd-hackers@FreeBSD.ORG, ponds!rivers@dg-rtp.dg.com
Subject:   Re: That annoying pty problem again...
Message-ID:  <199509251822.EAA27181@godzilla.zeta.org.au>

next in thread | raw e-mail | index | archive | help
>I just had the "old" vs. "new" (SIGHUP?) pty problem again.

>Just to refresh everone's memory, let me know if you've seen this:

>	1) Start an Xterm...

>	2) Start 'vi' in that xterm.

>	3) Shut down the X server, forcing logoff (i.e. CNTL-ALT-BS)

>	4) Restart the X server

>	5) Start another xterm - which happens to get the same
>	   pty as the one running 'vi'

>	6) Suddenly, you'll discover that some of your keystrokes are
>	   going to that (now supposedly dead) 'vi' session, which is
>	   also producing output to your pty (xterm) - along with
>	   the shell you have running in your xterm.

>	   That is - it would appear that a SIGHUP is getting lost; or
>	   the pty driver isn't sending one when the client side is cut
>	   off...

This should be fixed in current.

Bruce

----------------------------
revision 1.21
date: 1995/09/19 12:26:47;  author: bde;  state: Exp;  lines: +1 -2
Don't clear the session pointer in ptcclose().  It must be left alone
until the session leader exits so that a SIGHUP gets sent to the process
group and the pty slave gets revoked.
----------------------------
Index: tty_pty.c
===================================================================
RCS file: /a/ncvs/src/sys/kern/tty_pty.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -c -2 -r1.20 -r1.21
*** 1.20	1995/09/08 11:08:38
--- 1.21	1995/09/19 12:26:47
***************
*** 32,36 ****
   *
   *	@(#)tty_pty.c	8.2 (Berkeley) 9/23/93
!  * $Id: tty_pty.c,v 1.20 1995/09/08 11:08:38 bde Exp $
   */
  
--- 32,36 ----
   *
   *	@(#)tty_pty.c	8.2 (Berkeley) 9/23/93
!  * $Id: tty_pty.c,v 1.21 1995/09/19 12:26:47 bde Exp $
   */
  
***************
*** 323,327 ****
  
  	tp->t_oproc = 0;		/* mark closed */
- 	tp->t_session = 0;
  	return (0);
  }
--- 323,326 ----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199509251822.EAA27181>