changeset 58072:4ebc52bf6429

(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.
author Kim F. Storm <storm@cua.dk>
date Tue, 09 Nov 2004 09:40:37 +0000
parents 253aa382ba57
children 9412413950a3
files src/process.c
diffstat 1 files changed, 5 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/src/process.c	Tue Nov 09 09:40:07 2004 +0000
+++ b/src/process.c	Tue Nov 09 09:40:37 2004 +0000
@@ -3023,6 +3023,8 @@
     {
       int optn, optbits;
 
+    retry_connect:
+
       s = socket (lres->ai_family, lres->ai_socktype, lres->ai_protocol);
       if (s < 0)
 	{
@@ -3101,8 +3103,6 @@
 	  break;
 	}
 
-    retry_connect:
-
       immediate_quit = 1;
       QUIT;
 
@@ -3144,22 +3144,13 @@
 
       immediate_quit = 0;
 
-      if (xerrno == EINTR)
-	goto retry_connect;
-      if (xerrno == EADDRINUSE && retry < 20)
-	{
-	  /* A delay here is needed on some FreeBSD systems,
-	     and it is harmless, since this retrying takes time anyway
-	     and should be infrequent.  */
-	  Fsleep_for (make_number (1), Qnil);
-	  retry++;
-	  goto retry_connect;
-	}
-
       /* Discard the unwind protect closing S.  */
       specpdl_ptr = specpdl + count1;
       emacs_close (s);
       s = -1;
+
+      if (xerrno == EINTR)
+	goto retry_connect;
     }
 
   if (s >= 0)