[PATCH 1/2] ws2_32: Avoid an unnecessary goto.

Zebediah Figura zfigura at codeweavers.com
Fri Feb 4 19:35:36 CST 2022


Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
---
 dlls/ws2_32/socket.c | 10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c
index 4b3ca3c2507..b06fb341991 100644
--- a/dlls/ws2_32/socket.c
+++ b/dlls/ws2_32/socket.c
@@ -3305,8 +3305,9 @@ SOCKET WINAPI WSASocketW(int af, int type, int protocol,
 
     if (!num_startup)
     {
-        err = WSANOTINITIALISED;
-        goto done;
+        WARN( "not initialised\n" );
+        SetLastError( WSANOTINITIALISED );
+        return -1;
     }
 
     /* hack for WSADuplicateSocket */
@@ -3406,11 +3407,6 @@ SOCKET WINAPI WSASocketW(int af, int type, int protocol,
     }
     WSASetLastError(0);
     return ret;
-
-done:
-    WARN("\t\tfailed, error %d!\n", err);
-    SetLastError(err);
-    return INVALID_SOCKET;
 }
 
 /***********************************************************************
-- 
2.34.1




More information about the wine-devel mailing list