Subject: bug#569 closed by Chong Yidong <[email-masked]> (Re: 23.0.60; OSX: make-network-process reuses existing file descriptors)

From: [email-masked] (Emacs bug Tracking System)

This is an automatic notification regarding your bug report
which was filed against the emacs package:

#562: 23.0.60; OSX: make-network-process reuses existing file descriptors

It has been closed by Chong Yidong <[email-masked]>.

Their explanation is attached below along with your original report.
If this explanation is unsatisfactory and you have not received a
better one in a separate message then please contact Chong Yidong <[email-masked]> by
replying to this email.

-- 
562: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=562
Emacs Bug Tracking System
Contact [email-masked] with problems
>From [email-masked] Wed Aug 13 17:53:46 2008
From: Chong Yidong <[email-masked]>
To: YAMAMOTO Mitsuharu <[email-masked]>
Cc: Markus Triska <[email-masked]>, [email-masked]
Subject: Re: 23.0.60; OSX: make-network-process reuses existing file descriptors
Date: Wed, 13 Aug 2008 20:54:20 -0400

> > Commenting out a res_init call in process.c makes this go away for
> > me. I do not know what other consequences this has though:
>
> You can comment it out on Mac OS X, because calling `res_init' does
> not make sense at all on that platform.  Neither does linking
> libresolv.
>
>   http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01467.html
>   http://lists.gnu.org/archive/html/emacs-devel/2007-10/msg01254.html
>
> So, it turns out to be not only meaningless, but also harmful on a
> particular version (10.4) of Mac OS X.

I've undef'ed HAVE_LIBRESOLV and HAVE_RES_INIT in s/darwin.h, as you
suggested.  Thanks.

>From [email-masked] Thu Jul 17 07:22:52 2008
From: Markus Triska <[email-masked]>
To: [email-masked]
Subject: Re: 23.0.60; OSX: make-network-process reuses existing file descriptors
Date: Thu, 17 Jul 2008 16:22:25 +0200

> This is because p2 and p3 are both created with infd=outfd=0, thus
> closing the channel for p2 also closes that of p3.

Commenting out a res_init call in process.c makes this go away for me. I
do not know what other consequences this has though:

diff --git a/src/process.c b/src/process.c
index b0bebeb..b5aebdc 100644
--- a/src/process.c
+++ b/src/process.c
@@ -3366,7 +3374,7 @@ usage: (make-network-process &rest ARGS)  */)
       hints.ai_protocol = 0;
 
 #ifdef HAVE_RES_INIT
-      res_init ();
+      /* res_init (); */
 #endif
 
       ret = getaddrinfo (SDATA (host), portstring, &hints, &res);