OSSP CVS Repository

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

Check-in Number: 4481
Date: 2004-Apr-02 20:49:42 (local)
2004-Apr-02 18:49:42 (UTC)
User:rse
Branch:
Comment: remember the reason directly in the source, too
Tickets:
Inspections:
Files:
ossp-pkg/sa/sa.c      1.81 -> 1.82     13 inserted, 0 deleted

ossp-pkg/sa/sa.c 1.81 -> 1.82

--- sa.c 2004/04/02 18:47:39     1.81
+++ sa.c 2004/04/02 18:49:42     1.82
@@ -1482,6 +1482,19 @@
     /* perform the connect operation */
     if ((n = SA_SC_CALL_3(sa, connect, sa->fdSocket, raddr->saBuf, raddr->slBuf)) < 0) {
         if (errno != EINTR && errno != EINPROGRESS) {
+            /* we have to perform the following post-processing under
+               EINPROGRESS anway, but actually also for EINTR according
+               to Unix Network Programming, volume 1, section 5.9, W.
+               Richard Stevens: "What we are doing [] is restarting
+               the interrupted system call ourself. This is fine for
+               accept, along with the functions such as read, write,
+               select and open. But there is one function that we cannot
+               restart ourself: connect. If this function returns EINTR,
+               we cannot call it again, as doing so will return an
+               immediate error. When connect is interrupted by a caught
+               signal and is not automatically restarted, we must call
+               select to wait for the connection to complete, as we
+               describe in section 15.3." */
             error = errno;
             goto done;
         }

CVSTrac 2.0.1