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

This commit is contained in:
Michael Stefaniuc 2007-11-26 23:09:28 +01:00 committed by Alexandre Julliard
parent 6d8c2d744b
commit 61ed0c99e6
1 changed files with 2 additions and 2 deletions

View File

@ -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;