Path: 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: Date: 31 Mar 89 23:35:44 GMT Sender: daemon@tut.cis.ohio-state.edu Distribution: gnu Organization: GNUs Not Usenet Lines: 21 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!"======/