ws2_32: Replace a few -1 literals with SOCKET_ERROR.

Do a small tweak in WS2_send() so it looks more like WS2_recv().
This commit is contained in:
Francois Gouget 2007-03-08 15:30:53 +01:00 committed by Alexandre Julliard
parent fa41be3fdb
commit 7d5883d44b

View File

@ -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;