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

This commit is contained in:
Dmitry Timoshkov 2010-08-04 12:14:52 +09:00 committed by Alexandre Julliard
parent 5c05b14167
commit e0bbcea6fb
1 changed files with 10 additions and 9 deletions

View File

@ -1902,22 +1902,23 @@ int WINAPI WSAConnect( SOCKET s, const struct WS_sockaddr* name, int namelen,
/***********************************************************************
* 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)
{
int fd = get_sock_fd( s, FILE_READ_DATA, NULL );
int ret, status;
int fd, ret, status;
if (!ov)
{
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
fd = get_sock_fd( s, FILE_READ_DATA, NULL );
if (fd == -1)
{
SetLastError( WSAENOTSOCK );
return FALSE;
}
if (!ov)
{
release_sock_fd(s, fd);
SetLastError( ERROR_INVALID_PARAMETER );
return FALSE;
}
TRACE("socket %04lx, ptr %p %s, length %d, sendptr %p, len %d, ov %p\n",
s, name, debugstr_sockaddr(name), namelen, sendBuf, sendBufLen, ov);