Skip to content

Commit

Permalink
modules/statsd: fixes incorrect socket() return value check and log m…
Browse files Browse the repository at this point in the history
…essage
  • Loading branch information
mslehto committed Jan 25, 2016
1 parent 8ead5ae commit 06a9516
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/statsd/lib_statsd.c
Expand Up @@ -38,8 +38,8 @@ bool statsd_connect(void){
}

statsd_connection.sock = socket(serverAddr->ai_family, SOCK_DGRAM, IPPROTO_UDP);
if (statsd_connection.sock == 0 ){
LM_ERR("Statsd: could not initiate a connect to statsd\n");
if (statsd_connection.sock < 0 ){
LM_ERR("Statsd: could not create a socket for statsd connection\n");
return false;
}

Expand Down

0 comments on commit 06a9516

Please sign in to comment.