X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=plugins%2Fcheck_pgsql.c;h=e1484566328961e69b89652e19f6e9ff53c7f6ef;hb=8b2381c97634804bad7aa0b48345a9e1216b5512;hp=2d80fad1bb04560c89fafc1dcd1c639ad942bcc0;hpb=00f86a8f6bfe204e6aa9eb2290ed9f3a8945cebe;p=nagiosplug.git diff --git a/plugins/check_pgsql.c b/plugins/check_pgsql.c index 2d80fad..e148456 100644 --- a/plugins/check_pgsql.c +++ b/plugins/check_pgsql.c @@ -30,8 +30,7 @@ const char *progname = "check_pgsql"; #define EMAIL "kdebisschop@users.sourceforge.net" #define SUMMARY "Tests to see if a PostgreSQL DBMS is accepting connections.\n" -#define OPTIONS "\ -\[-c critical_time] [-w warning_time] [-t timeout] [-H host]\n\ +#define OPTIONS "[-c critical_time] [-w warning_time] [-t timeout] [-H host]\n\ [-P port] [-d database] [-l logname] [-p password]" #define LONGOPTIONS "\ @@ -80,7 +79,6 @@ enum { #include "config.h" #include "common.h" #include "utils.h" -#include #include int process_arguments (int, char **); @@ -248,7 +246,6 @@ process_arguments (int argc, char **argv) { int c; -#ifdef HAVE_GETOPT_H int option_index = 0; static struct option long_options[] = { {"help", no_argument, 0, 'h'}, @@ -264,15 +261,11 @@ process_arguments (int argc, char **argv) {"database", required_argument, 0, 'd'}, {0, 0, 0, 0} }; -#endif while (1) { -#ifdef HAVE_GETOPT_H c = getopt_long (argc, argv, "hVt:c:w:H:P:d:l:p:a:", long_options, &option_index); -#else - c = getopt (argc, argv, "hVt:c:w:H:P:d:l:p:a:"); -#endif + if (c == EOF) break;