summaryrefslogtreecommitdiff
path: root/src/process.c
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2007-10-17 15:57:30 +0000
committerChong Yidong <cyd@stupidchicken.com>2007-10-17 15:57:30 +0000
commit08116b48fed9f1abb1503bfbdccad19f67bc7b68 (patch)
tree0c5c008d7ebdd7dd3c628803fcabd72e79b5bae6 /src/process.c
parent44bb704d642ae0a817710183af583cd278d8d82d (diff)
downloademacs-08116b48fed9f1abb1503bfbdccad19f67bc7b68.tar.gz
emacs-08116b48fed9f1abb1503bfbdccad19f67bc7b68.tar.bz2
emacs-08116b48fed9f1abb1503bfbdccad19f67bc7b68.zip
Link to libs for calling res_init() if available.
(Fmake_network_process): Call res_init() before getaddrinfo or gethostbyname, if possible.
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/process.c b/src/process.c
index 19275e40db5..6749ebda117 100644
--- a/src/process.c
+++ b/src/process.c
@@ -121,6 +121,12 @@ Boston, MA 02110-1301, USA. */
#include <sys/wait.h>
#endif
+#ifdef HAVE_RES_INIT
+#include <netinet/in.h>
+#include <arpa/nameser.h>
+#include <resolv.h>
+#endif
+
#include "lisp.h"
#include "systime.h"
#include "systty.h"
@@ -3083,6 +3089,11 @@ usage: (make-network-process &rest ARGS) */)
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 @@ usage: (make-network-process &rest ARGS) */)
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;