ws2_32: Replace a few -1 literals with SOCKET_ERROR.

Francois Gouget fgouget at free.fr
Thu Mar 8 08:30:53 CST 2007


Do a small tweak in WS2_send() so it looks more like WS2_recv().
---
 dlls/ws2_32/socket.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 1d007a9..aaf9c1b 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -1204,7 +1204,7 @@ static int WS2_recv( int fd, struct iovec* iov, int count,
         if ( !hdr.msg_name )
         {
             WSASetLastError( WSAEFAULT );
-            n = -1;
+            n = SOCKET_ERROR;
             goto out;
         }
     }
@@ -1313,7 +1313,7 @@ static int WS2_send( int fd, struct iovec* iov, int count,
                      const struct WS_sockaddr *to, INT tolen, DWORD dwFlags )
 {
     struct msghdr hdr;
-    int n = -1;
+    int n;
     TRACE( "fd %d, iovec %p, count %d addr %s, len %d, flags %x\n",
            fd, iov, count, debugstr_sockaddr(to), tolen, dwFlags);
 
@@ -1325,6 +1325,7 @@ static int WS2_send( int fd, struct iovec* iov, int count,
         if ( !hdr.msg_name )
         {
             WSASetLastError( WSAEFAULT );
+            n = SOCKET_ERROR;
             goto out;
         }
 
@@ -2732,7 +2733,7 @@ int WINAPI WS_select(int nfds, WS_fd_set *ws_readfds,
     if (!(pollfds = fd_sets_to_poll( ws_readfds, ws_writefds, ws_exceptfds, &count )) && count)
     {
         SetLastError( ERROR_NOT_ENOUGH_MEMORY );
-        return -1;
+        return SOCKET_ERROR;
     }
 
     if (ws_timeout) timeout = (ws_timeout->tv_sec * 1000) + (ws_timeout->tv_usec + 999) / 1000;
-- 
1.4.4.4




More information about the wine-patches mailing list