summaryrefslogtreecommitdiffstats
path: root/plugins/check_tcp.c
diff options
context:
space:
mode:
authorM. Sean Finney <seanius@users.sourceforge.net>2005-10-31 20:03:19 (GMT)
committerM. Sean Finney <seanius@users.sourceforge.net>2005-10-31 20:03:19 (GMT)
commit3038819fef47495af2730b0d2df2a5a8475fc7bb (patch)
tree978a1706ef546a153bfc41af7f33959b4543678c /plugins/check_tcp.c
parent0ff7d99a5e75683e778943884e60a11251183f45 (diff)
downloadmonitoring-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/check_tcp.c')
-rw-r--r--plugins/check_tcp.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/plugins/check_tcp.c b/plugins/check_tcp.c
index 2a77637..cb7a869 100644
--- a/plugins/check_tcp.c
+++ b/plugins/check_tcp.c
@@ -31,7 +31,6 @@ const char *email = "nagiosplug-devel@lists.sourceforge.net";
31#ifdef HAVE_SSL 31#ifdef HAVE_SSL
32static int check_cert = FALSE; 32static int check_cert = FALSE;
33static int days_till_exp; 33static int days_till_exp;
34static char *randbuff = "";
35# define my_recv(buf, len) ((flags & FLAG_SSL) ? np_net_ssl_read(buf, len) : read(sd, buf, len)) 34# define my_recv(buf, len) ((flags & FLAG_SSL) ? np_net_ssl_read(buf, len) : read(sd, buf, len))
36# define my_send(buf, len) ((flags & FLAG_SSL) ? np_net_ssl_write(buf, len) : send(sd, buf, len, 0)) 35# define my_send(buf, len) ((flags & FLAG_SSL) ? np_net_ssl_write(buf, len) : send(sd, buf, len, 0))
37#else 36#else
@@ -51,7 +50,6 @@ static char *QUIT = NULL;
51static int PROTOCOL = IPPROTO_TCP; /* most common is default */ 50static int PROTOCOL = IPPROTO_TCP; /* most common is default */
52static int PORT = 0; 51static int PORT = 0;
53 52
54static char timestamp[17] = "";
55static int server_port = 0; 53static int server_port = 0;
56static char *server_address = NULL; 54static char *server_address = NULL;
57static char *server_send = NULL; 55static char *server_send = NULL;
@@ -199,7 +197,7 @@ main (int argc, char **argv)
199 if(flags & FLAG_VERBOSE) { 197 if(flags & FLAG_VERBOSE) {
200 printf("Using service %s\n", SERVICE); 198 printf("Using service %s\n", SERVICE);
201 printf("Port: %d\n", PORT); 199 printf("Port: %d\n", PORT);
202 printf("flags: 0x%x\n", flags); 200 printf("flags: 0x%x\n", (int)flags);
203 } 201 }
204 202
205 if(EXPECT && !server_expect_count) 203 if(EXPECT && !server_expect_count)
@@ -242,7 +240,7 @@ main (int argc, char **argv)
242 } 240 }
243 241
244 if(flags & FLAG_VERBOSE) { 242 if(flags & FLAG_VERBOSE) {
245 printf("server_expect_count: %d\n", server_expect_count); 243 printf("server_expect_count: %d\n", (int)server_expect_count);
246 for(i = 0; i < server_expect_count; i++) 244 for(i = 0; i < server_expect_count; i++)
247 printf("\t%d: %s\n", i, server_expect[i]); 245 printf("\t%d: %s\n", i, server_expect[i]);
248 } 246 }
@@ -274,7 +272,7 @@ main (int argc, char **argv)
274 /* print raw output if we're debugging */ 272 /* print raw output if we're debugging */
275 if(flags & FLAG_VERBOSE) 273 if(flags & FLAG_VERBOSE)
276 printf("received %d bytes from host\n#-raw-recv-------#\n%s\n#-raw-recv-------#\n", 274 printf("received %d bytes from host\n#-raw-recv-------#\n%s\n#-raw-recv-------#\n",
277 len + 1, status); 275 (int)len + 1, status);
278 while(isspace(status[len])) status[len--] = '\0'; 276 while(isspace(status[len])) status[len--] = '\0';
279 277
280 for (i = 0; i < server_expect_count; i++) { 278 for (i = 0; i < server_expect_count; i++) {