(Fmake_network_process): Call res_init() before getaddrinfo or
gethostbyname, if possible.
#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"
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
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;