Module: wine Branch: master Commit: 7d5883d44bb2654788f5f4bae315b510554d1457 URL: http://source.winehq.org/git/wine.git/?a=commit;h=7d5883d44bb2654788f5f4bae3...
Author: Francois Gouget fgouget@free.fr Date: Thu Mar 8 15:30:53 2007 +0100
ws2_32: Replace a few -1 literals with SOCKET_ERROR.
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;