🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.bug
Article #1545

18.53 fails to close socket on 'unreachable host' error

#1545
From: Randal L. Schwartz
Date: Fri, 31 Mar 1989 23:35
21 lines
1429 bytes
In 18.53, process.c, near line 1118, lies the following text:

------------------------------
  s = socket (host_info->h_addrtype, SOCK_STREAM, 0);
  if (s < 0) 
    report_file_error ("error creating socket", Fcons (name, Qnil));

  if (connect (s, &address, sizeof address) == -1)
    error ("Host \"%s\" not responding", XSTRING (host)->data);
------------------------------

If the connect fails, the filedes 's' is not reclaimed with a
'close(s)'.  Eventually, you will run out of file descriptors (as I
did when scanning for hosts that support a particular server).  Fix:
add close(s) under that last if (curly braced, of course) before the
error() call.

/=====Randal L. Schwartz, Stonehenge Consulting Services (503)777-0095========\
{        on contract to BiiN (for now :-) Hillsboro, Oregon, USA.             }
{<@intel-iwarp.arpa:merlyn@intelob.intel.com> ...!uunet!tektronix!biin!merlyn }
\=====Cute quote: "Welcome to Oregon... home of the California Raisins!"======/
Technical Details
Message-ID: <m0f6Y1h-000FVuC@intelob.intel.com>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!intelob.intel.com!merlyn

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!intelob.intel.com!merlyn
From: merlyn@intelob.intel.com (Randal L. Schwartz)
Newsgroups: gnu.emacs.bug
Subject: 18.53 fails to close socket on 'unreachable host' error
Message-ID: <m0f6Y1h-000FVuC@intelob.intel.com>
Date: 31 Mar 89 23:35:44 GMT
Sender: daemon@tut.cis.ohio-state.edu
Distribution: gnu
Organization: GNUs Not Usenet
Lines: 21