Commit e0bbcea6 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

ws2_32: Rearrange the code to avoid a needless release_sock_fd().

parent 5c05b141
...@@ -1902,20 +1902,21 @@ int WINAPI WSAConnect( SOCKET s, const struct WS_sockaddr* name, int namelen, ...@@ -1902,20 +1902,21 @@ int WINAPI WSAConnect( SOCKET s, const struct WS_sockaddr* name, int namelen,
/*********************************************************************** /***********************************************************************
* ConnectEx * ConnectEx
*/ */
BOOL WINAPI WS2_ConnectEx(SOCKET s, const struct WS_sockaddr* name, int namelen, static BOOL WINAPI WS2_ConnectEx(SOCKET s, const struct WS_sockaddr* name, int namelen,
PVOID sendBuf, DWORD sendBufLen, LPDWORD sent, LPOVERLAPPED ov) PVOID sendBuf, DWORD sendBufLen, LPDWORD sent, LPOVERLAPPED ov)
{ {
int fd = get_sock_fd( s, FILE_READ_DATA, NULL ); int fd, ret, status;
int ret, status;
if (fd == -1) if (!ov)
{ {
SetLastError( WSAENOTSOCK ); SetLastError( ERROR_INVALID_PARAMETER );
return FALSE; return FALSE;
} }
if (!ov)
fd = get_sock_fd( s, FILE_READ_DATA, NULL );
if (fd == -1)
{ {
release_sock_fd(s, fd); SetLastError( WSAENOTSOCK );
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE; return FALSE;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment