OSSP CVS Repository

ossp - Check-in [4473]
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [Patchset]  [Tagging/Branching

Check-in Number: 4473
Date: 2004-Apr-02 14:26:59 (local)
2004-Apr-02 12:26:59 (UTC)
User:thl
Branch:
Comment: restart accept(2) after interrupted system call
Tickets:
Inspections:
Files:
ossp-pkg/sa/ChangeLog      1.30 -> 1.31     6 inserted, 0 deleted
ossp-pkg/sa/sa.c      1.78 -> 1.79     4 inserted, 1 deleted

ossp-pkg/sa/ChangeLog 1.30 -> 1.31

--- ChangeLog    2004/03/26 16:49:40     1.30
+++ ChangeLog    2004/04/02 12:26:59     1.31
@@ -13,6 +13,12 @@
 
   Changes between 1.1.0 and FIXME (10-Nov-2003 to FIXME)
 
+   o Restart accept(2) after interrupted system call.
+     OSSP lmtp2nntp daemon failed to accept a connection after a signal
+     handler was run on Solaris which caused the system call to be
+     interrupted. Issue was found and reported by Amos Gouaux.
+     [Thomas Lotterer <thl@dev.de.cw.net>]
+
    o Add SA_CHECK_SOCKOPT autoconf check to detect setsockopt failing
      under run-time on Solaris 2.6,8,9,10 and Debian 2.2 because
      SO_RCVTIMEO|SO_SNDTIMEO are defined but not implemented.


ossp-pkg/sa/sa.c 1.78 -> 1.79

--- sa.c 2004/03/26 16:57:14     1.78
+++ sa.c 2004/04/02 12:26:59     1.79
@@ -1602,7 +1602,10 @@
 
     /* perform accept operation on underlying socket */
     sa_size = (socklen_t)sizeof(sa_buf);
-    if ((s = SA_SC_CALL_3(sa, accept, sa->fdSocket, (struct sockaddr *)&sa_buf, &sa_size)) == -1)
+    do {
+        s = SA_SC_CALL_3(sa, accept, sa->fdSocket, (struct sockaddr *)&sa_buf, &sa_size);
+    } while (s == -1 && errno == EINTR);
+    if (s == -1)
         return SA_RC(SA_ERR_SYS);
 
     /* create result address object */

CVSTrac 2.0.1