Commit 61ed0c99 authored by Michael Stefaniuc's avatar Michael Stefaniuc Committed by Alexandre Julliard

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

parent 6d8c2d74
......@@ -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;
......
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