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

Alexandre Julliard julliard at winehq.org
Wed Aug 4 12:27:23 CDT 2010


Module: wine
Branch: master
Commit: e0bbcea6fb99cca17e33b063d876e04f53800b9d
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e0bbcea6fb99cca17e33b063d876e04f53800b9d

Author: Dmitry Timoshkov <dmitry at codeweavers.com>
Date:   Wed Aug  4 12:14:52 2010 +0900

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

---

 dlls/ws2_32/socket.c |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 22c72f3..f129b08 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -1902,20 +1902,21 @@ 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;
-    if (fd == -1)
+    int fd, ret, status;
+
+    if (!ov)
     {
-        SetLastError( WSAENOTSOCK );
+        SetLastError( ERROR_INVALID_PARAMETER );
         return FALSE;
     }
-    if (!ov)
+
+    fd = get_sock_fd( s, FILE_READ_DATA, NULL );
+    if (fd == -1)
     {
-        release_sock_fd(s, fd);
-        SetLastError( ERROR_INVALID_PARAMETER );
+        SetLastError( WSAENOTSOCK );
         return FALSE;
     }
 




More information about the wine-cvs mailing list