OSSP CVS Repository

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

Check-in Number: 4474
Date: 2004-Apr-02 14:27:32 (local)
2004-Apr-02 12:27:32 (UTC)
User:thl
Branch:
Comment: restart accept(2) after interrupted system call
Tickets:
Inspections:
Files:
ossp-pkg/l2/l2_ut_sa.c      1.23 -> 1.24     4 inserted, 1 deleted

ossp-pkg/l2/l2_ut_sa.c 1.23 -> 1.24

--- l2_ut_sa.c   2004/03/26 17:14:48     1.23
+++ l2_ut_sa.c   2004/04/02 12:27:32     1.24
@@ -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