rpcrt4: socket() returns -1 on error so check the return value against that.

Michael Stefaniuc mstefani at redhat.de
Mon Nov 26 16:09:28 CST 2007


I would have compared against INVALID_SOCKET but rpcrt4 uses the
hosts socket() version and not the Win32 one.
---
 dlls/rpcrt4/rpc_transport.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/rpcrt4/rpc_transport.c b/dlls/rpcrt4/rpc_transport.c
index dfb7ece..40cc613 100644
--- a/dlls/rpcrt4/rpc_transport.c
+++ b/dlls/rpcrt4/rpc_transport.c
@@ -773,7 +773,7 @@ static RPC_STATUS rpcrt4_ncacn_ip_tcp_open(RpcConnection* Connection)
     }
 
     sock = socket(ai_cur->ai_family, ai_cur->ai_socktype, ai_cur->ai_protocol);
-    if (sock < 0)
+    if (sock == -1)
     {
       WARN("socket() failed: %s\n", strerror(errno));
       continue;
@@ -850,7 +850,7 @@ static RPC_STATUS rpcrt4_protseq_ncacn_ip_tcp_open_endpoint(RpcServerProtseq *pr
         }
 
         sock = socket(ai_cur->ai_family, ai_cur->ai_socktype, ai_cur->ai_protocol);
-        if (sock < 0)
+        if (sock == -1)
         {
             WARN("socket() failed: %s\n", strerror(errno));
             status = RPC_S_CANT_CREATE_ENDPOINT;
-- 
1.5.3.6
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.winehq.org/pipermail/wine-patches/attachments/20071126/045ff681/attachment.pgp 


More information about the wine-patches mailing list