Module: kamailio
Branch: master
Commit: 06a9516af72c87b9aa6e709f72eb6472951f398b
URL:
https://github.com/kamailio/kamailio/commit/06a9516af72c87b9aa6e709f72eb647…
Author: Mikko Lehto <mslehto(a)iki.fi>
Committer: Mikko Lehto <mslehto(a)iki.fi>
Date: 2016-01-26T00:38:20+02:00
modules/statsd: fixes incorrect socket() return value check and log message
---
Modified: modules/statsd/lib_statsd.c
---
Diff:
https://github.com/kamailio/kamailio/commit/06a9516af72c87b9aa6e709f72eb647…
Patch:
https://github.com/kamailio/kamailio/commit/06a9516af72c87b9aa6e709f72eb647…
---
diff --git a/modules/statsd/lib_statsd.c b/modules/statsd/lib_statsd.c
index 76744f0..878b452 100644
--- a/modules/statsd/lib_statsd.c
+++ b/modules/statsd/lib_statsd.c
@@ -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;
}