# HG changeset patch # User Chong Yidong # Date 1192636650 0 # Node ID b949ffc47cbac707576f824495546265eddae11a # Parent 26f0746bead10d46391e1953764e05ca0f9234db Link to libs for calling res_init() if available. (Fmake_network_process): Call res_init() before getaddrinfo or gethostbyname, if possible. diff -r 26f0746bead1 -r b949ffc47cba src/process.c --- a/src/process.c Wed Oct 17 15:57:17 2007 +0000 +++ b/src/process.c Wed Oct 17 15:57:30 2007 +0000 @@ -121,6 +121,12 @@ #include #endif +#ifdef HAVE_RES_INIT +#include +#include +#include +#endif + #include "lisp.h" #include "systime.h" #include "systty.h" @@ -3083,6 +3089,11 @@ hints.ai_family = family; hints.ai_socktype = socktype; hints.ai_protocol = 0; + +#ifdef HAVE_RES_INIT + res_init (); +#endif + ret = getaddrinfo (SDATA (host), portstring, &hints, &res); if (ret) #ifdef HAVE_GAI_STRERROR @@ -3128,6 +3139,11 @@ as it may `hang' Emacs for a very long time. */ immediate_quit = 1; QUIT; + +#ifdef HAVE_RES_INIT + res_init (); +#endif + host_info_ptr = gethostbyname (SDATA (host)); immediate_quit = 0;