aboutsummaryrefslogtreecommitdiffstats
path: root/src/process.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/process.c')
-rw-r--r--src/process.c19
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)