From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: YAMAMOTO Mitsuharu Newsgroups: gmane.emacs.devel Subject: Re: bug#6781: emacs server with X11 build on OSX Date: Sat, 25 Sep 2010 12:57:23 +0900 Organization: Faculty of Science, Chiba University Message-ID: References: <83F33443-0C3F-4F9B-B584-D9301250B8FC@raeburn.org> <87k4o6wgam.fsf@stupidchicken.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII X-Trace: dough.gmane.org 1285387060 28682 80.91.229.12 (25 Sep 2010 03:57:40 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 25 Sep 2010 03:57:40 +0000 (UTC) Cc: Juanma Barranquero , 6781@debbugs.gnu.org, emacs-devel@gnu.org, Ken Raeburn , Andreas Schwab , Leo To: Chong Yidong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Sep 25 05:57:38 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1OzLtI-0002hq-MS for ged-emacs-devel@m.gmane.org; Sat, 25 Sep 2010 05:57:36 +0200 Original-Received: from localhost ([127.0.0.1]:37670 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzLtI-00018k-6V for ged-emacs-devel@m.gmane.org; Fri, 24 Sep 2010 23:57:36 -0400 Original-Received: from [140.186.70.92] (port=53291 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OzLtC-00018e-7K for emacs-devel@gnu.org; Fri, 24 Sep 2010 23:57:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OzLtA-0004Uj-9b for emacs-devel@gnu.org; Fri, 24 Sep 2010 23:57:29 -0400 Original-Received: from mathmail.math.s.chiba-u.ac.jp ([133.82.132.2]:63007) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OzLt9-0004UK-ON for emacs-devel@gnu.org; Fri, 24 Sep 2010 23:57:28 -0400 Original-Received: from church.math.s.chiba-u.ac.jp (church [133.82.132.36]) by mathmail.math.s.chiba-u.ac.jp (Postfix) with ESMTP id 766CDC0557; Sat, 25 Sep 2010 12:57:23 +0900 (JST) In-Reply-To: <87k4o6wgam.fsf@stupidchicken.com> User-Agent: Wanderlust/2.14.0 (Africa) SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (=?ISO-8859-4?Q?Shij=F2?=) APEL/10.6 Emacs/22.3 (sparc-sun-solaris2.8) MULE/5.0 (SAKAKI) X-detected-operating-system: by eggs.gnu.org: NetBSD 3.0 (DF) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:130823 Archived-At: >>>>> On Wed, 04 Aug 2010 11:25:53 -0400, Chong Yidong said: > YAMAMOTO Mitsuharu writes: >> I suspect there is a bug in getaddrinfo on Mac OS X 10.6.4. At >> least, the behavior of the following program is incompatible with >> that on Mac OS X 10.5.8. > Could you write a PROBLEMS entry about your discovery? I think it is more natural to specify NULL for the unspecified port case, and it also works as a workaround. YAMAMOTO Mitsuharu mituharu@math.s.chiba-u.ac.jp === modified file 'src/process.c' *** src/process.c 2010-06-03 22:47:35 +0000 --- src/process.c 2010-09-25 03:52:03 +0000 *************** *** 3446,3452 **** /* SERVICE can either be a string or int. Convert to a C string for later use by getaddrinfo. */ if (EQ (service, Qt)) ! portstring = "0"; else if (INTEGERP (service)) { sprintf (portbuf, "%ld", (long) XINT (service)); --- 3446,3455 ---- /* SERVICE can either be a string or int. Convert to a C string for later use by getaddrinfo. */ if (EQ (service, Qt)) ! /* We pass NULL for unspecified port, because some versions of ! Darwin return EAI_NONAME for getaddrinfo ("localhost", "0", ! ...). */ ! portstring = NULL; else if (INTEGERP (service)) { sprintf (portbuf, "%ld", (long) XINT (service)); *************** *** 3472,3482 **** ret = getaddrinfo (SDATA (host), portstring, &hints, &res); if (ret) #ifdef HAVE_GAI_STRERROR ! error ("%s/%s %s", SDATA (host), portstring, gai_strerror(ret)); #else ! error ("%s/%s getaddrinfo error %d", SDATA (host), portstring, ret); #endif immediate_quit = 0; goto open_socket; --- 3475,3493 ---- ret = getaddrinfo (SDATA (host), portstring, &hints, &res); if (ret) + { #ifdef HAVE_GAI_STRERROR ! if (portstring) ! error ("%s/%s %s", SDATA (host), portstring, gai_strerror(ret)); ! else ! error ("%s %s", SDATA (host), gai_strerror(ret)); #else ! if (portstring) ! error ("%s/%s getaddrinfo error %d", SDATA (host), portstring, ret); ! else ! error ("%s getaddrinfo error %d", SDATA (host), ret); #endif + } immediate_quit = 0; goto open_socket;