diff options
| author | Chong Yidong | 2007-10-17 15:57:30 +0000 |
|---|---|---|
| committer | Chong Yidong | 2007-10-17 15:57:30 +0000 |
| commit | 08116b48fed9f1abb1503bfbdccad19f67bc7b68 (patch) | |
| tree | 0c5c008d7ebdd7dd3c628803fcabd72e79b5bae6 /src/process.c | |
| parent | 44bb704d642ae0a817710183af583cd278d8d82d (diff) | |
| download | emacs-08116b48fed9f1abb1503bfbdccad19f67bc7b68.tar.gz 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.c | 16 |
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. */ | |||
| 121 | #include <sys/wait.h> | 121 | #include <sys/wait.h> |
| 122 | #endif | 122 | #endif |
| 123 | 123 | ||
| 124 | #ifdef HAVE_RES_INIT | ||
| 125 | #include <netinet/in.h> | ||
| 126 | #include <arpa/nameser.h> | ||
| 127 | #include <resolv.h> | ||
| 128 | #endif | ||
| 129 | |||
| 124 | #include "lisp.h" | 130 | #include "lisp.h" |
| 125 | #include "systime.h" | 131 | #include "systime.h" |
| 126 | #include "systty.h" | 132 | #include "systty.h" |
| @@ -3083,6 +3089,11 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3083 | hints.ai_family = family; | 3089 | hints.ai_family = family; |
| 3084 | hints.ai_socktype = socktype; | 3090 | hints.ai_socktype = socktype; |
| 3085 | hints.ai_protocol = 0; | 3091 | hints.ai_protocol = 0; |
| 3092 | |||
| 3093 | #ifdef HAVE_RES_INIT | ||
| 3094 | res_init (); | ||
| 3095 | #endif | ||
| 3096 | |||
| 3086 | ret = getaddrinfo (SDATA (host), portstring, &hints, &res); | 3097 | ret = getaddrinfo (SDATA (host), portstring, &hints, &res); |
| 3087 | if (ret) | 3098 | if (ret) |
| 3088 | #ifdef HAVE_GAI_STRERROR | 3099 | #ifdef HAVE_GAI_STRERROR |
| @@ -3128,6 +3139,11 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3128 | as it may `hang' Emacs for a very long time. */ | 3139 | as it may `hang' Emacs for a very long time. */ |
| 3129 | immediate_quit = 1; | 3140 | immediate_quit = 1; |
| 3130 | QUIT; | 3141 | QUIT; |
| 3142 | |||
| 3143 | #ifdef HAVE_RES_INIT | ||
| 3144 | res_init (); | ||
| 3145 | #endif | ||
| 3146 | |||
| 3131 | host_info_ptr = gethostbyname (SDATA (host)); | 3147 | host_info_ptr = gethostbyname (SDATA (host)); |
| 3132 | immediate_quit = 0; | 3148 | immediate_quit = 0; |
| 3133 | 3149 | ||