GNU bug report logs - #6781
emacs server with X11 build on OSX

Previous Next

Package: emacs;

Reported by: Juanma Barranquero <lekktu <at> gmail.com>

Date: Mon, 2 Aug 2010 20:23:02 UTC

Severity: normal

Done: Juanma Barranquero <lekktu <at> gmail.com>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
To: Chong Yidong <cyd <at> stupidchicken.com>
Cc: Juanma Barranquero <lekktu <at> gmail.com>, 6781 <at> debbugs.gnu.org, emacs-devel <at> gnu.org, Ken Raeburn <raeburn <at> raeburn.org>, Andreas Schwab <schwab <at> linux-m68k.org>, Leo <sdl.web <at> gmail.com>
Subject: bug#6781: emacs server with X11 build on OSX
Date: Sat, 25 Sep 2010 12:57:23 +0900
>>>>> On Wed, 04 Aug 2010 11:25:53 -0400, Chong Yidong <cyd <at> stupidchicken.com> said:

> YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp> 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 <at> 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;





This bug report was last modified 14 years and 303 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.