diff options
| author | Kim F. Storm | 2004-11-09 09:40:37 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2004-11-09 09:40:37 +0000 |
| commit | 4e9dd03b8c61ea20314b74691d5a2f74302e6953 (patch) | |
| tree | daa7587cae88af4c3b55c89945b0275bd1f22a5f /src | |
| parent | cdb805a93521d865839ed31a30d3752b2dc3e9e4 (diff) | |
| download | emacs-4e9dd03b8c61ea20314b74691d5a2f74302e6953.tar.gz emacs-4e9dd03b8c61ea20314b74691d5a2f74302e6953.zip | |
(Fmake_network_process): Remove kludge for interrupted
connects on BSD. If connect is interrupted, just close socket and
start over rather than sleeping and retry with same socket.
Diffstat (limited to 'src')
| -rw-r--r-- | src/process.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/process.c b/src/process.c index bebcd577e9e..00bac03dc2b 100644 --- a/src/process.c +++ b/src/process.c | |||
| @@ -3023,6 +3023,8 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3023 | { | 3023 | { |
| 3024 | int optn, optbits; | 3024 | int optn, optbits; |
| 3025 | 3025 | ||
| 3026 | retry_connect: | ||
| 3027 | |||
| 3026 | s = socket (lres->ai_family, lres->ai_socktype, lres->ai_protocol); | 3028 | s = socket (lres->ai_family, lres->ai_socktype, lres->ai_protocol); |
| 3027 | if (s < 0) | 3029 | if (s < 0) |
| 3028 | { | 3030 | { |
| @@ -3101,8 +3103,6 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3101 | break; | 3103 | break; |
| 3102 | } | 3104 | } |
| 3103 | 3105 | ||
| 3104 | retry_connect: | ||
| 3105 | |||
| 3106 | immediate_quit = 1; | 3106 | immediate_quit = 1; |
| 3107 | QUIT; | 3107 | QUIT; |
| 3108 | 3108 | ||
| @@ -3144,22 +3144,13 @@ usage: (make-network-process &rest ARGS) */) | |||
| 3144 | 3144 | ||
| 3145 | immediate_quit = 0; | 3145 | immediate_quit = 0; |
| 3146 | 3146 | ||
| 3147 | if (xerrno == EINTR) | ||
| 3148 | goto retry_connect; | ||
| 3149 | if (xerrno == EADDRINUSE && retry < 20) | ||
| 3150 | { | ||
| 3151 | /* A delay here is needed on some FreeBSD systems, | ||
| 3152 | and it is harmless, since this retrying takes time anyway | ||
| 3153 | and should be infrequent. */ | ||
| 3154 | Fsleep_for (make_number (1), Qnil); | ||
| 3155 | retry++; | ||
| 3156 | goto retry_connect; | ||
| 3157 | } | ||
| 3158 | |||
| 3159 | /* Discard the unwind protect closing S. */ | 3147 | /* Discard the unwind protect closing S. */ |
| 3160 | specpdl_ptr = specpdl + count1; | 3148 | specpdl_ptr = specpdl + count1; |
| 3161 | emacs_close (s); | 3149 | emacs_close (s); |
| 3162 | s = -1; | 3150 | s = -1; |
| 3151 | |||
| 3152 | if (xerrno == EINTR) | ||
| 3153 | goto retry_connect; | ||
| 3163 | } | 3154 | } |
| 3164 | 3155 | ||
| 3165 | if (s >= 0) | 3156 | if (s >= 0) |