diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-08-08 05:09:40 +0000 |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-08-08 05:09:40 +0000 |
commit | a9f992033fc32c0cca125e80d3d96aacfc78b802 (patch) | |
tree | bad34ea7077716b4b074ee66ba3259097a4f3108 /plugins/check_dig.c | |
parent | 65ca899d2c98b6342783922a5709c4b61e6b2b1f (diff) | |
download | monitoring-plugins-a9f992033fc32c0cca125e80d3d96aacfc78b802.tar.gz |
fix a variety of compiler warnings about qualifier discards and other pedantic stuff
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@663 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins/check_dig.c')
-rw-r--r-- | plugins/check_dig.c | 141 |
1 files changed, 79 insertions, 62 deletions
diff --git a/plugins/check_dig.c b/plugins/check_dig.c index 3d82298f..7c39a243 100644 --- a/plugins/check_dig.c +++ b/plugins/check_dig.c @@ -1,22 +1,21 @@ /***************************************************************************** -* -* This program is free software; you can redistribute it and/or modify -* it under the terms of the GNU General Public License as published by -* the Free Software Foundation; either version 2 of the License, or -* (at your option) any later version. -* -* This program is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -* + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + *****************************************************************************/ -#include "config.h" #include "common.h" #include "netutils.h" #include "utils.h" @@ -36,50 +35,6 @@ enum { DEFAULT_PORT = 53 }; -void -print_usage (void) -{ - printf (_("\ -Usage: %s -H host -l lookup [-p <server port>] [-w <warning interval>]\n\ - [-c <critical interval>] [-t <timeout>] [-v]\n"), - progname); - printf (" %s (-h|--help)\n", progname); - printf (" %s (-V|--version)\n", progname); -} - -void -print_help (void) -{ - char *myport; - - asprintf (&myport, "%d", DEFAULT_PORT); - - print_revision (progname, revision); - - printf (_(COPYRIGHT), copyright, email); - - printf (_("Test the DNS service on the specified host using dig\n\n")); - - print_usage (); - - printf (_(UT_HELP_VRSN)); - - printf (_(UT_HOST_PORT), 'P', myport); - - printf (_("\ - -l, --lookup=STRING\n\ - machine name to lookup\n")); - - printf (_(UT_WARN_CRIT)); - - printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT); - - printf (_(UT_VERBOSE)); - - support (); -} - - char *query_address = NULL; char *dns_server = NULL; int verbose = FALSE; @@ -88,14 +43,20 @@ int warning_interval = -1; int critical_interval = -1; + + + + int main (int argc, char **argv) { char input_buffer[MAX_INPUT_BUFFER]; - char *command_line = NULL; - char *output = ""; + char *command_line; + char *output; int result = STATE_UNKNOWN; + output = strdup (""); + /* Set signal handling and alarm */ if (signal (SIGALRM, popen_timeout_alarm_handler) == SIG_ERR) usage (_("Cannot catch SIGALRM\n")); @@ -188,6 +149,11 @@ main (int argc, char **argv) return result; } + + + + + /* process command-line arguments */ int process_arguments (int argc, char **argv) @@ -298,4 +264,55 @@ validate_arguments (void) { return OK; } + + + + + + +void +print_help (void) +{ + char *myport; + + asprintf (&myport, "%d", DEFAULT_PORT); + + print_revision (progname, revision); + + printf (_(COPYRIGHT), copyright, email); + + printf (_("Test the DNS service on the specified host using dig\n\n")); + + print_usage (); + + printf (_(UT_HELP_VRSN)); + + printf (_(UT_HOST_PORT), 'P', myport); + + printf (_("\ + -l, --lookup=STRING\n\ + machine name to lookup\n")); + + printf (_(UT_WARN_CRIT)); + + printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT); + + printf (_(UT_VERBOSE)); + + support (); +} + + + + +void +print_usage (void) +{ + printf (_("\ +Usage: %s -H host -l lookup [-p <server port>] [-w <warning interval>]\n\ + [-c <critical interval>] [-t <timeout>] [-v]\n"), + progname); + printf (" %s (-h|--help)\n", progname); + printf (" %s (-V|--version)\n", progname); +} |