diff options
author | Greg Cox <gcox@fibbsbozza.local> | 2014-07-29 22:52:12 (GMT) |
---|---|---|
committer | Greg Cox <gcox@fibbsbozza.local> | 2014-07-29 22:52:12 (GMT) |
commit | 4273dd06ff3e52094d6b267d00e8c51dd74de364 (patch) | |
tree | 425d127da5dbec7013999ed01b469fc3f72992d9 /plugins/check_tcp.c | |
parent | f05e7016320f4671fbf86cc5abc277efea20f79e (diff) | |
parent | 6f3d5825b203b75aef8d68bf0d117e7a1a4c0616 (diff) | |
download | monitoring-plugins-4273dd06ff3e52094d6b267d00e8c51dd74de364.tar.gz |
Merge remote-tracking branch 'upstream/master'refs/pull/1257/head
Conflicts:
plugins/netutils.c
Diffstat (limited to 'plugins/check_tcp.c')
-rw-r--r-- | plugins/check_tcp.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c index 0a6e2b2..f75c523 100644 --- a/plugins/check_tcp.c +++ b/plugins/check_tcp.c | |||
@@ -32,13 +32,12 @@ char *progname; | |||
32 | const char *copyright = "1999-2008"; | 32 | const char *copyright = "1999-2008"; |
33 | const char *email = "devel@monitoring-plugins.org"; | 33 | const char *email = "devel@monitoring-plugins.org"; |
34 | 34 | ||
35 | #include <ctype.h> | ||
36 | |||
37 | #include "common.h" | 35 | #include "common.h" |
38 | #include "netutils.h" | 36 | #include "netutils.h" |
39 | #include "utils.h" | 37 | #include "utils.h" |
40 | #include "utils_tcp.h" | 38 | #include "utils_tcp.h" |
41 | 39 | ||
40 | #include <ctype.h> | ||
42 | #include <sys/select.h> | 41 | #include <sys/select.h> |
43 | 42 | ||
44 | #ifdef HAVE_SSL | 43 | #ifdef HAVE_SSL |
@@ -354,8 +353,13 @@ main (int argc, char **argv) | |||
354 | printf("Unexpected response from host/socket on "); | 353 | printf("Unexpected response from host/socket on "); |
355 | else | 354 | else |
356 | printf("%.3f second response time on ", elapsed_time); | 355 | printf("%.3f second response time on ", elapsed_time); |
357 | if(server_address[0] != '/') | 356 | if(server_address[0] != '/') { |
358 | printf("port %d", server_port); | 357 | if (host_specified) |
358 | printf("%s port %d", | ||
359 | server_address, server_port); | ||
360 | else | ||
361 | printf("port %d", server_port); | ||
362 | } | ||
359 | else | 363 | else |
360 | printf("socket %s", server_address); | 364 | printf("socket %s", server_address); |
361 | } | 365 | } |