OSSP CVS Repository

ossp - Difference in ossp-pkg/sa/sa.c versions 1.81 and 1.82
Not logged in
[Honeypot]  [Browse]  [Home]  [Login]  [Reports
[Search]  [Ticket]  [Timeline
  [History

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