emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/trunk r99752: * process.c (Fmake_network_pr


From: Chong Yidong
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r99752: * process.c (Fmake_network_process): Don't apply Bug#5173 fix for Windows.
Date: Fri, 26 Mar 2010 20:45:32 -0400
User-agent: Bazaar (2.0.3)

------------------------------------------------------------
revno: 99752
committer: Chong Yidong <address@hidden>
branch nick: trunk
timestamp: Fri 2010-03-26 20:45:32 -0400
message:
  * process.c (Fmake_network_process): Don't apply Bug#5173 fix for Windows.
modified:
  src/ChangeLog
  src/process.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2010-03-25 08:56:15 +0000
+++ b/src/ChangeLog     2010-03-27 00:45:32 +0000
@@ -1,3 +1,8 @@
+2010-03-27  Chong Yidong  <address@hidden>
+
+       * process.c (Fmake_network_process): Don't apply Bug#5173 fix for
+       Windows.
+
 2010-03-25  YAMAMOTO Mitsuharu  <address@hidden>
 
        * process.c (Fmake_network_process): Don't call turn_on_atimers around

=== modified file 'src/process.c'
--- a/src/process.c     2010-03-25 08:56:15 +0000
+++ b/src/process.c     2010-03-27 00:45:32 +0000
@@ -3534,6 +3534,8 @@
     {
       int optn, optbits;
 
+    retry_connect:
+
       s = socket (lres->ai_family, lres->ai_socktype, lres->ai_protocol);
       if (s < 0)
        {
@@ -3636,12 +3638,14 @@
 #endif
 #endif
 #endif
+
+#ifndef WINDOWSNT
       if (xerrno == EINTR)
        {
          /* Unlike most other syscalls connect() cannot be called
             again.  (That would return EALREADY.)  The proper way to
             wait for completion is select(). */
-         int sc;
+         int sc, len;
          SELECT_TYPE fdset;
        retry_select:
          FD_ZERO (&fdset);
@@ -3651,23 +3655,23 @@
                       (EMACS_TIME *)0);
          if (sc == -1)
            {
-             if (errno == EINTR) 
+             if (errno == EINTR)
                goto retry_select;
-             else 
+             else
                report_file_error ("select failed", Qnil);
            }
          eassert (sc > 0);
-         {
-           int len = sizeof xerrno;
-           eassert (FD_ISSET (s, &fdset));
-           if (getsockopt (s, SOL_SOCKET, SO_ERROR, &xerrno, &len) == -1)
-             report_file_error ("getsockopt failed", Qnil);
-           if (xerrno != 0)
-             errno = xerrno, report_file_error ("error during connect", Qnil);
-           else
-             break;
-         }
+
+         len = sizeof xerrno;
+         eassert (FD_ISSET (s, &fdset));
+         if (getsockopt (s, SOL_SOCKET, SO_ERROR, &xerrno, &len) == -1)
+           report_file_error ("getsockopt failed", Qnil);
+         if (xerrno)
+           errno = xerrno, report_file_error ("error during connect", Qnil);
+         else
+           break;
        }
+#endif /* !WINDOWSNT */
 
       immediate_quit = 0;
 
@@ -3675,6 +3679,11 @@
       specpdl_ptr = specpdl + count1;
       emacs_close (s);
       s = -1;
+
+#ifdef WINDOWSNT
+      if (xerrno == EINTR)
+       goto retry_connect;
+#endif
     }
 
   if (s >= 0)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]