🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #98873

18.57 fails to notice network connections being closed

#98873
From: Joe Wells
Date: Sat, 23 Feb 1991 04:13
62 lines
2480 bytes
(emacs-version)
"GNU Emacs 18.57.18 of Fri Feb 22 1991 on bigbird (berkeley-unix)"

GNU Emacs 18.57 (and 18.56) fails to notice when network connections
created with open-network-stream are closed by the other end.  This is due
to some modifications that were designed to improved the handling of dying
subprocesses.  Unfortunately, these modifications affected the treatment
of dying network connections at the same time, and in an adverse manner.

I'm including a fix that has been tested under SunOS 4.1 on a Sun 4/370.
I suspect this fix may be an incomplete one, since there are many
execution paths that I didn't deal with.

-- 
Enjoy,

Joe Wells <jbw@bu.edu>
----------------------------------------------------------------------
*** process.c-dist	Tue Jan 15 20:28:48 1991
--- process.c	Fri Feb 22 22:59:48 1991
***************
*** 1671,1674 ****
--- 1671,1675 ----
  	    {
  	      int nread;
+ 	      int netconn_p;
  
  	      FD_CLR (channel, &Available);
***************
*** 1684,1687 ****
--- 1685,1689 ----
  	      if (NULL (proc))
  		continue;
+ 	      netconn_p = NETCONN_P (proc);
  
  #ifdef vipc
***************
*** 1733,1737 ****
  		 With luck, a closed pipe will be accompanied by
  		 subprocess termination and SIGCHLD.  */
! 	      else if (nread == 0)
  		;
  #endif /* O_NDELAY */
--- 1735,1739 ----
  		 With luck, a closed pipe will be accompanied by
  		 subprocess termination and SIGCHLD.  */
! 	      else if (nread == 0 && ! netconn_p)
  		;
  #endif /* O_NDELAY */
***************
*** 1752,1756 ****
     gone just because its pipe is closed.  */
  #ifdef SIGCHLD
! 	      else if (nread == 0)
  		;
  #endif
--- 1754,1758 ----
     gone just because its pipe is closed.  */
  #ifdef SIGCHLD
! 	      else if (nread == 0 && ! netconn_p)
  		;
  #endif
Technical Details
Message-ID: <JBW.91Feb22231345@bigbird.bu.edu>
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!unreplyable!garbage

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: fb2f1,1554e1bf0ab67347,start
X-Google-Attributes: gidfb2f1,public
X-Google-ArrivalTime: 1991-02-22 20:13:45 PST
Path: arc1-ca.pugleaf.net!gmdzi!unido!mcsun!uunet!tut.cis.ohio-state.edu!unreplyable!garbage
From: jbw@BIGBIRD.BU.EDU (Joe Wells)
Newsgroups: gnu.emacs.bug
Subject: 18.57 fails to notice network connections being closed
Message-ID: <JBW.91Feb22231345@bigbird.bu.edu>
Date: 23 Feb 91 04:13:45 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: Boston University Computer Science Department
Lines: 62
Approved: bug-gnu-emacs@prep.ai.mit.edu