summaryrefslogtreecommitdiff
path: root/net-mgmt/nagios-plugins/files/patch-plugins_netutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'net-mgmt/nagios-plugins/files/patch-plugins_netutils.c')
-rw-r--r--net-mgmt/nagios-plugins/files/patch-plugins_netutils.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/net-mgmt/nagios-plugins/files/patch-plugins_netutils.c b/net-mgmt/nagios-plugins/files/patch-plugins_netutils.c
index b94e00358ba4..b211deaf4615 100644
--- a/net-mgmt/nagios-plugins/files/patch-plugins_netutils.c
+++ b/net-mgmt/nagios-plugins/files/patch-plugins_netutils.c
@@ -1,6 +1,6 @@
---- plugins/netutils.c.orig 2015-07-30 21:40:06 UTC
+--- plugins/netutils.c.orig 2016-08-01 16:27:46 UTC
+++ plugins/netutils.c
-@@ -158,7 +158,7 @@ int
+@@ -179,7 +179,7 @@ int
np_net_connect (const char *host_name, int port, int *sd, int proto)
{
struct addrinfo hints;
@@ -9,7 +9,7 @@
struct sockaddr_un su;
char port_str[6], host[MAX_HOST_ADDRESS_LENGTH];
size_t len;
-@@ -185,12 +185,13 @@ np_net_connect (const char *host_name, i
+@@ -206,7 +206,7 @@ np_net_connect (const char *host_name, i
memcpy (host, host_name, len);
host[len] = '\0';
snprintf (port_str, sizeof (port_str), "%d", port);
@@ -17,14 +17,16 @@
+ result = getaddrinfo (host, port_str, &hints, &res0);
if (result != 0) {
- printf ("%s\n", gai_strerror (result));
+ if (result == EAI_NONAME)
+@@ -215,6 +215,7 @@ np_net_connect (const char *host_name, i
+ printf ("%s\n", gai_strerror (result));
return STATE_UNKNOWN;
}
+ res = res0;
while (res) {
/* attempt to create a socket */
-@@ -198,7 +199,7 @@ np_net_connect (const char *host_name, i
+@@ -222,7 +223,7 @@ np_net_connect (const char *host_name, i
if (*sd < 0) {
printf ("%s\n", _("Socket creation failed"));
@@ -33,7 +35,7 @@
return STATE_UNKNOWN;
}
-@@ -221,7 +222,7 @@ np_net_connect (const char *host_name, i
+@@ -245,7 +246,7 @@ np_net_connect (const char *host_name, i
close (*sd);
res = res->ai_next;
}