diff options
author | M. Sean Finney <seanius@users.sourceforge.net> | 2005-10-31 20:03:19 +0000 |
---|---|---|
committer | M. Sean Finney <seanius@users.sourceforge.net> | 2005-10-31 20:03:19 +0000 |
commit | 3038819fef47495af2730b0d2df2a5a8475fc7bb (patch) | |
tree | 978a1706ef546a153bfc41af7f33959b4543678c /plugins/netutils.c | |
parent | 0ff7d99a5e75683e778943884e60a11251183f45 (diff) | |
download | monitoring-plugins-3038819fef47495af2730b0d2df2a5a8475fc7bb.tar.gz |
code cleanups, largely resulting from turning on -Wall. mostly
unused variables and explicit casting issues, but there were a
couple gotchas in there too.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1267 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/netutils.c')
-rw-r--r-- | plugins/netutils.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plugins/netutils.c b/plugins/netutils.c index 6f3a1510..b4c3944b 100644 --- a/plugins/netutils.c +++ b/plugins/netutils.c | |||
@@ -31,6 +31,8 @@ | |||
31 | * | 31 | * |
32 | ****************************************************************************/ | 32 | ****************************************************************************/ |
33 | 33 | ||
34 | #define LOCAL_TIMEOUT_ALARM_HANDLER | ||
35 | |||
34 | #include "common.h" | 36 | #include "common.h" |
35 | #include "netutils.h" | 37 | #include "netutils.h" |
36 | 38 | ||
@@ -217,14 +219,14 @@ np_net_connect (const char *host_name, int port, int *sd, int proto) | |||
217 | /* else the hostname is interpreted as a path to a unix socket */ | 219 | /* else the hostname is interpreted as a path to a unix socket */ |
218 | else { | 220 | else { |
219 | if(strlen(host_name) >= UNIX_PATH_MAX){ | 221 | if(strlen(host_name) >= UNIX_PATH_MAX){ |
220 | die(_("Supplied path too long unix domain socket")); | 222 | die(STATE_UNKNOWN, _("Supplied path too long unix domain socket")); |
221 | } | 223 | } |
222 | memset(&su, 0, sizeof(su)); | 224 | memset(&su, 0, sizeof(su)); |
223 | su.sun_family = AF_UNIX; | 225 | su.sun_family = AF_UNIX; |
224 | strncpy(su.sun_path, host_name, UNIX_PATH_MAX); | 226 | strncpy(su.sun_path, host_name, UNIX_PATH_MAX); |
225 | *sd = socket(PF_UNIX, SOCK_STREAM, 0); | 227 | *sd = socket(PF_UNIX, SOCK_STREAM, 0); |
226 | if(sd < 0){ | 228 | if(sd < 0){ |
227 | die(_("Socket creation failed")); | 229 | die(STATE_UNKNOWN, _("Socket creation failed")); |
228 | } | 230 | } |
229 | result = connect(*sd, (struct sockaddr *)&su, sizeof(su)); | 231 | result = connect(*sd, (struct sockaddr *)&su, sizeof(su)); |
230 | if (result < 0 && errno == ECONNREFUSED) | 232 | if (result < 0 && errno == ECONNREFUSED) |