]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
STABLE14-rx-lwp-sendmsg-20070614
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 14 Jun 2007 20:05:03 +0000 (20:05 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 14 Jun 2007 20:05:03 +0000 (20:05 +0000)
update the lwp version of rxi_sendmsg to return the same error, -1,
returned by the pthread version.

replace errno with WSAGetLastError() in the Windows blocks so that
the correct error value is checked.

(cherry picked from commit 46a931d020da24dd534e1064ea9fbe693acbdf65)

src/rx/rx_lwp.c
src/rx/rx_packet.c

index 9748b7d6e4279afdae1f66906d8815e4e89232d7..5f9f1c172c3292dec651a9c91dc7cb20fed63c5d 100644 (file)
@@ -445,12 +445,12 @@ rxi_Sendmsg(osi_socket socket, struct msghdr *msg_p, int flags)
            if (!(sfds = IOMGR_AllocFDSet())) {
                (osi_Msg "rx failed to alloc fd_set: ");
                perror("rx_sendmsg");
-               return 3;
+               return -1;
            }
            FD_SET(socket, sfds);
        }
 #ifdef AFS_NT40_ENV
-       if (errno)
+       if (WSAGetLastError())
 #elif defined(AFS_LINUX22_ENV)
        /* linux unfortunately returns ECONNREFUSED if the target port
         * is no longer in use */
@@ -463,7 +463,7 @@ rxi_Sendmsg(osi_socket socket, struct msghdr *msg_p, int flags)
        {
            (osi_Msg "rx failed to send packet: ");
            perror("rx_sendmsg");
-           return 3;
+           return -1;
        }
        while ((err = select(socket + 1, 0, sfds, 0, 0)) != 1) {
            if (err >= 0 || errno != EINTR)
index bf1f4da23353e5e64c70c688cb9297054a77a311..37f984921085e6deff9763f3a2352ccd1331c757 100644 (file)
@@ -2216,7 +2216,7 @@ rxi_SendPacket(struct rx_call *call, struct rx_connection *conn,
             * code.  So, when this happens let's "down" the host NOW so
             * we don't sit around waiting for this host to timeout later.
             */
-               if (call && code == -1 && errno == WSAEHOSTUNREACH)
+               if (call && code == -1 && WSAGetLastError() == WSAEHOSTUNREACH)
                        call->lastReceiveTime = 0;
 #endif
 #if defined(KERNEL) && defined(AFS_LINUX20_ENV)