Code

Remove getopt_long checks
authorTon Voon <tonvoon@users.sourceforge.net>
Tue, 11 Mar 2003 22:22:12 +0000 (22:22 +0000)
committerTon Voon <tonvoon@users.sourceforge.net>
Tue, 11 Mar 2003 22:22:12 +0000 (22:22 +0000)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@396 f882894a-f735-0410-b71e-b25c423dba1c

32 files changed:
plugins/check_by_ssh.c
plugins/check_dig.c
plugins/check_disk.c
plugins/check_dns.c
plugins/check_fping.c
plugins/check_hpjd.c
plugins/check_http.c
plugins/check_ide-smart.c
plugins/check_ldap.c
plugins/check_load.c
plugins/check_mrtg.c
plugins/check_mrtgtraf.c
plugins/check_mysql.c
plugins/check_nagios.c
plugins/check_nt.c
plugins/check_nwstat.c
plugins/check_overcr.c
plugins/check_pgsql.c
plugins/check_ping.c
plugins/check_procs.c
plugins/check_radius.c
plugins/check_real.c
plugins/check_smtp.c
plugins/check_snmp.c
plugins/check_ssh.c
plugins/check_swap.c
plugins/check_tcp.c
plugins/check_time.c
plugins/check_udp.c
plugins/check_ups.c
plugins/check_users.c
plugins/check_vsz.c

index 0cffaeb2ef251c81e77bd4e5c6aa8efb6fc343f7..866044bd3b9e62975e538c908a5d149d77f19110 100644 (file)
@@ -174,7 +174,6 @@ process_arguments (int argc, char **argv)
        char *p1, *p2;
        size_t len;
 
        char *p1, *p2;
        size_t len;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"version", no_argument, 0, 'V'},
        int option_index = 0;
        static struct option long_options[] = {
                {"version", no_argument, 0, 'V'},
@@ -195,7 +194,6 @@ process_arguments (int argc, char **argv)
                {"use-ipv6", no_argument, 0, '6'},
                {0, 0, 0, 0}
        };
                {"use-ipv6", no_argument, 0, '6'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                return ERROR;
 
        if (argc < 2)
                return ERROR;
@@ -205,13 +203,8 @@ process_arguments (int argc, char **argv)
                        strcpy (argv[c], "-t");
 
        while (1) {
                        strcpy (argv[c], "-t");
 
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c =
-                       getopt_long (argc, argv, "Vvh46ft:H:O:p:i:u:l:C:n:s:", long_options,
+               c = getopt_long (argc, argv, "Vvh46ft:H:O:p:i:u:l:C:n:s:", long_options,
                                                                         &option_index);
                                                                         &option_index);
-#else
-               c = getopt (argc, argv, "Vvh46ft:H:O:p:i:u:l:C:n:s:");
-#endif
 
                if (c == -1 || c == EOF)
                        break;
 
                if (c == -1 || c == EOF)
                        break;
index 5c6f1e12e8bdb45985d0ac535d8c79bdcab1de42..59c3b7c8f3f3130062136e009d4f36a10224494d 100644 (file)
@@ -146,7 +146,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
@@ -156,17 +155,12 @@ process_arguments (int argc, char **argv)
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                return ERROR;
 
        while (1) {
 
        if (argc < 2)
                return ERROR;
 
        while (1) {
-#ifdef HAVE_GETOPT_H
                c = getopt_long (argc, argv, "hVvt:l:H:", long_options, &option_index);
                c = getopt_long (argc, argv, "hVvt:l:H:", long_options, &option_index);
-#else
-               c = getopt (argc, argv, "hVvt:l:H:");
-#endif
 
                if (c == -1 || c == EOF)
                        break;
 
                if (c == -1 || c == EOF)
                        break;
index 1afc76208763601786ee6c9d20f6e8543cd04348..5fac4eae1b9222a891d6f5cf4e3d83ca94d4a943 100644 (file)
@@ -217,7 +217,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"warning", required_argument, 0, 'w'},
        int option_index = 0;
        static struct option long_options[] = {
                {"warning", required_argument, 0, 'w'},
@@ -235,7 +234,6 @@ process_arguments (int argc, char **argv)
 
                {0, 0, 0, 0}
        };
 
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                return ERROR;
 
        if (argc < 2)
                return ERROR;
@@ -245,12 +243,7 @@ process_arguments (int argc, char **argv)
                        strcpy (argv[c], "-t");
 
        while (1) {
                        strcpy (argv[c], "-t");
 
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c =
-                       getopt_long (argc, argv, "+?Vqhvet:c:w:p:x:m", long_options, &option_index);
-#else
-               c = getopt (argc, argv, "+?Vqhvet:c:w:p:x:m");
-#endif
+               c = getopt_long (argc, argv, "+?Vqhvet:c:w:p:x:m", long_options, &option_index);
 
                if (c == -1 || c == EOF)
                        break;
 
                if (c == -1 || c == EOF)
                        break;
index ac62c45775d7ad939e0977185bf1344e6c688244..7c79893ab7dc4b6ea0d008911254a480160bd7e9 100644 (file)
@@ -262,7 +262,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int opt_index = 0;
        static struct option long_opts[] = {
                {"help", no_argument, 0, 'h'},
        int opt_index = 0;
        static struct option long_opts[] = {
                {"help", no_argument, 0, 'h'},
@@ -275,7 +274,6 @@ process_arguments (int argc, char **argv)
                {"expected-address", required_argument, 0, 'a'},
                {0, 0, 0, 0}
        };
                {"expected-address", required_argument, 0, 'a'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                return ERROR;
 
        if (argc < 2)
                return ERROR;
@@ -285,11 +283,7 @@ process_arguments (int argc, char **argv)
                        strcpy (argv[c], "-t");
 
        while (1) {
                        strcpy (argv[c], "-t");
 
        while (1) {
-#ifdef HAVE_GETOPT_H
                c = getopt_long (argc, argv, "hVvt:H:s:r:a:", long_opts, &opt_index);
                c = getopt_long (argc, argv, "hVvt:H:s:r:a:", long_opts, &opt_index);
-#else
-               c = getopt (argc, argv, "hVvt:H:s:r:a:");
-#endif
 
                if (c == -1 || c == EOF)
                        break;
 
                if (c == -1 || c == EOF)
                        break;
index 8887afe8eeaf647fe695da34b07d244aac18afdd..ac203f523d3a646cd8e2dd11f54f098857cd0426 100644 (file)
@@ -202,7 +202,6 @@ process_arguments (int argc, char **argv)
        int c;
        char *rv[2];
 
        int c;
        char *rv[2];
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
@@ -215,7 +214,6 @@ process_arguments (int argc, char **argv)
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
-#endif
 
        rv[PL] = NULL;
        rv[RTA] = NULL;
 
        rv[PL] = NULL;
        rv[RTA] = NULL;
@@ -231,12 +229,7 @@ process_arguments (int argc, char **argv)
        }
 
        while (1) {
        }
 
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c =
-                       getopt_long (argc, argv, "+hVvH:c:w:b:n:", long_options, &option_index);
-#else
-               c = getopt (argc, argv, "+hVvH:c:w:b:n:");
-#endif
+               c = getopt_long (argc, argv, "+hVvH:c:w:b:n:", long_options, &option_index);
 
                if (c == -1 || c == EOF || c == 1)
                        break;
 
                if (c == -1 || c == EOF || c == 1)
                        break;
index 267de2e04f6edce4d14529574fd27ef0c194b485..d8583724391aadcc644ea91fac3d9d0015b16e2d 100644 (file)
@@ -390,7 +390,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
@@ -402,18 +401,13 @@ process_arguments (int argc, char **argv)
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                return ERROR;
 
        
        while (1) {
 
        if (argc < 2)
                return ERROR;
 
        
        while (1) {
-#ifdef HAVE_GETOPT_H
                c = getopt_long (argc, argv, "+hVH:C:", long_options, &option_index);
                c = getopt_long (argc, argv, "+hVH:C:", long_options, &option_index);
-#else
-               c = getopt (argc, argv, "+?hVH:C:");
-#endif
 
                if (c == -1 || c == EOF || c == 1)
                        break;
 
                if (c == -1 || c == EOF || c == 1)
                        break;
index cf86d469a91ff7c09c7d0eb6f27ab47dd2caa44e..d6f2c15a252d750d2ce64c4b39b9d4ec5ac4558e 100644 (file)
@@ -296,7 +296,6 @@ process_arguments (int argc, char **argv)
 {
        int c = 1;
 
 {
        int c = 1;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                STD_LONG_OPTS,
        int option_index = 0;
        static struct option long_options[] = {
                STD_LONG_OPTS,
@@ -317,7 +316,6 @@ process_arguments (int argc, char **argv)
                {"min", required_argument, 0, 'm'},
                {0, 0, 0, 0}
        };
                {"min", required_argument, 0, 'm'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                return ERROR;
 
        if (argc < 2)
                return ERROR;
@@ -335,14 +333,8 @@ process_arguments (int argc, char **argv)
                        strcpy (argv[c], "-n");
        }
 
                        strcpy (argv[c], "-n");
        }
 
-#define OPTCHARS "Vvht:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:"
-
        while (1) {
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c = getopt_long (argc, argv, OPTCHARS, long_options, &option_index);
-#else
-               c = getopt (argc, argv, OPTCHARS);
-#endif
+               c = getopt_long (argc, argv, "Vvht:c:w:H:P:I:a:e:p:s:R:r:u:f:C:nlLSm:", long_options, &option_index);
                if (c == -1 || c == EOF)
                        break;
 
                if (c == -1 || c == EOF)
                        break;
 
@@ -1068,12 +1060,7 @@ void
 print_usage (void)
 {
        printf ("Usage:\n" " %s %s\n"
 print_usage (void)
 {
        printf ("Usage:\n" " %s %s\n"
-#ifdef HAVE_GETOPT_H
                " %s (-h | --help) for detailed help\n"
                " %s (-V | --version) for version information\n",
                " %s (-h | --help) for detailed help\n"
                " %s (-V | --version) for version information\n",
-#else
-               " %s -h for detailed help\n"
-               " %s -V for version information\n",
-#endif
        progname, OPTIONS, progname, progname);
 }
        progname, OPTIONS, progname, progname);
 }
index 869f7dc0a76eac3f874e8d25d0d30abea4fe7eee..47d9d840467362373263a7d299eb5c8fd567ee51 100644 (file)
@@ -44,7 +44,6 @@
 #include <unistd.h>
 #include <linux/hdreg.h>
 #include <linux/types.h>
 #include <unistd.h>
 #include <linux/hdreg.h>
 #include <linux/types.h>
-#include <getopt.h>
 #include <errno.h>
        
 #define NR_ATTRIBUTES  30
 #include <errno.h>
        
 #define NR_ATTRIBUTES  30
@@ -342,7 +341,6 @@ main (int argc, char *argv[])
        int o, longindex;
        int retval = 0;
        
        int o, longindex;
        int retval = 0;
        
-#ifdef HAVE_GETOPT_H
        const struct option longopts[] = { 
                        {"device", required_argument, 0, 'd'}, 
                {"immediate", no_argument, 0, 'i'}, 
        const struct option longopts[] = { 
                        {"device", required_argument, 0, 'd'}, 
                {"immediate", no_argument, 0, 'i'}, 
@@ -354,16 +352,10 @@ main (int argc, char *argv[])
                {"version", no_argument, 0, 'V'}, {0, 0, 0, 0} 
        };
        
                {"version", no_argument, 0, 'V'}, {0, 0, 0, 0} 
        };
        
-#endif /*  */
                while (1) {
                
                while (1) {
                
-#ifdef HAVE_GETOPT_H
                        o = getopt_long (argc, argv, "+d:iq10nhV", longopts, &longindex);
                
                        o = getopt_long (argc, argv, "+d:iq10nhV", longopts, &longindex);
                
-#else  /*  */
-                       o = getopt (argc, argv, "+d:iq10nhV");
-               
-#endif /*  */
                        if (o == -1 || o == EOF)
                        break;
                switch (o) {
                        if (o == -1 || o == EOF)
                        break;
                switch (o) {
index ac11c58f03975fd0de85fc1d08ae5e064818b881..90fe6225eefe91a6f97dedb2dbab214e023ee5d3 100644 (file)
@@ -130,7 +130,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        /* initialize the long option struct */
        static struct option longopts[] = {
        int option_index = 0;
        /* initialize the long option struct */
        static struct option longopts[] = {
@@ -147,7 +146,6 @@ process_arguments (int argc, char **argv)
                {"crit", required_argument, 0, 'c'},
                {0, 0, 0, 0}
        };
                {"crit", required_argument, 0, 'c'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                return ERROR;
 
        if (argc < 2)
                return ERROR;
@@ -158,11 +156,7 @@ process_arguments (int argc, char **argv)
        }
 
        while (1) {
        }
 
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c =     getopt_long (argc, argv, "hVt:c:w:H:b:p:a:D:P:", longopts, &option_index);
-#else
-               c = getopt (argc, argv, "+?hVt:c:w:H:b:p:a:D:P:");
-#endif
+               c = getopt_long (argc, argv, "hVt:c:w:H:b:p:a:D:P:", longopts, &option_index);
 
                if (c == -1 || c == EOF)
                        break;
 
                if (c == -1 || c == EOF)
                        break;
index 7d60d2343a85d2ee1054c5f2f61ca09474b58b0b..ba1a59830ae8d0ec0d55b06ac33fca66cf024396 100644 (file)
@@ -155,7 +155,6 @@ process_arguments (int argc, char **argv)
 {
        int c = 0;
 
 {
        int c = 0;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"warning", required_argument, 0, 'w'},
        int option_index = 0;
        static struct option long_options[] = {
                {"warning", required_argument, 0, 'w'},
@@ -164,19 +163,13 @@ process_arguments (int argc, char **argv)
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
-#endif
-
-#define OPTCHARS "Vhc:w:"
 
        if (argc < 2)
                return ERROR;
 
        while (1) {
 
        if (argc < 2)
                return ERROR;
 
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c = getopt_long (argc, argv, OPTCHARS, long_options, &option_index);
-#else
-               c = getopt (argc, argv, OPTCHARS);
-#endif
+               c = getopt_long (argc, argv, "Vhc:w:", long_options, &option_index);
+
                if (c == -1 || c == EOF)
                        break;
 
                if (c == -1 || c == EOF)
                        break;
 
index e26e2e66b7ccfae5e513ad0fce8d3773fd9f6242..095dcbc8ccd63200145e98532f20a3786cdb71b4 100644 (file)
@@ -214,7 +214,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"logfile", required_argument, 0, 'F'},
        int option_index = 0;
        static struct option long_options[] = {
                {"logfile", required_argument, 0, 'F'},
@@ -230,7 +229,6 @@ process_arguments (int argc, char **argv)
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                return ERROR;
 
        if (argc < 2)
                return ERROR;
@@ -245,13 +243,8 @@ process_arguments (int argc, char **argv)
        }
 
        while (1) {
        }
 
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c =
-                       getopt_long (argc, argv, "hVF:e:a:v:c:w:l:u:", long_options,
+               c = getopt_long (argc, argv, "hVF:e:a:v:c:w:l:u:", long_options,
                                                                         &option_index);
                                                                         &option_index);
-#else
-               c = getopt (argc, argv, "hVF:e:a:v:c:w:l:u:");
-#endif
 
                if (c == -1 || c == EOF)
                        break;
 
                if (c == -1 || c == EOF)
                        break;
@@ -370,12 +363,7 @@ void
 print_usage (void)
 {
        printf ("Usage:\n" " %s %s\n"
 print_usage (void)
 {
        printf ("Usage:\n" " %s %s\n"
-#ifdef HAVE_GETOPT_H
                                        " %s (-h | --help) for detailed help\n"
                                        " %s (-V | --version) for version information\n",
                                        " %s (-h | --help) for detailed help\n"
                                        " %s (-V | --version) for version information\n",
-#else
-                                       " %s -h for detailed help\n"
-                                       " %s -V for version information\n",
-#endif
                                        progname, OPTIONS, progname, progname);
 }
                                        progname, OPTIONS, progname, progname);
 }
index 94e6e0808102906b48cbbfccb82c5dd0674c91e1..21791ae9f25f7b89db2012872c87368fad8b5669 100644 (file)
@@ -231,7 +231,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option longopts[] = {
                {"logfile", required_argument, 0, 'F'},
        int option_index = 0;
        static struct option longopts[] = {
                {"logfile", required_argument, 0, 'F'},
@@ -245,7 +244,6 @@ process_arguments (int argc, char **argv)
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                return ERROR;
 
        if (argc < 2)
                return ERROR;
@@ -260,11 +258,7 @@ process_arguments (int argc, char **argv)
        }
 
        while (1) {
        }
 
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c =     getopt_long (argc, argv, "hVF:e:a:c:w:", longopts, &option_index);
-#else
-               c = getopt (argc, argv, "hVF:e:a:c:w:");
-#endif
+               c = getopt_long (argc, argv, "hVF:e:a:c:w:", longopts, &option_index);
 
                if (c == -1 || c == EOF)
                        break;
 
                if (c == -1 || c == EOF)
                        break;
index 18324c81784ff100ae02fc40f7a7022b943b5715..307481463371417e8f3cb36bf0294726008d7880 100644 (file)
@@ -126,7 +126,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
@@ -139,18 +138,12 @@ process_arguments (int argc, char **argv)
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 1)
                return ERROR;
 
        while (1) {
 
        if (argc < 1)
                return ERROR;
 
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c =
-                       getopt_long (argc, argv, "hVP:p:u:d:H:", long_options, &option_index);
-#else
-               c = getopt (argc, argv, "hVP:p:u:d:H:");
-#endif
+               c = getopt_long (argc, argv, "hVP:p:u:d:H:", long_options, &option_index);
 
                if (c == -1 || c == EOF)
                        break;
 
                if (c == -1 || c == EOF)
                        break;
index 5c4cd4a3a7d769126b7bea5df1d25f45a612c4e4..649bec4317b92272734e2a7a3b93a22c012f01ac 100644 (file)
@@ -144,7 +144,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"filename", required_argument, 0, 'F'},
        int option_index = 0;
        static struct option long_options[] = {
                {"filename", required_argument, 0, 'F'},
@@ -154,7 +153,6 @@ process_arguments (int argc, char **argv)
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                return ERROR;
 
        if (argc < 2)
                return ERROR;
@@ -172,11 +170,7 @@ process_arguments (int argc, char **argv)
        }
 
        while (1) {
        }
 
        while (1) {
-#ifdef HAVE_GETOPT_H
                c = getopt_long (argc, argv, "+hVF:C:e:", long_options, &option_index);
                c = getopt_long (argc, argv, "+hVF:C:e:", long_options, &option_index);
-#else
-               c = getopt (argc, argv, "+hVF:C:e:");
-#endif
 
                if (c == -1 || c == EOF || c == 1)
                        break;
 
                if (c == -1 || c == EOF || c == 1)
                        break;
index 1c9dc0adac0c1d29fce17a1c26093cca5f75c190..c7baa474215a9c4553657514fc280c12918710e6 100644 (file)
@@ -387,7 +387,6 @@ int main(int argc, char **argv){
 int process_arguments(int argc, char **argv){
        int c;
 
 int process_arguments(int argc, char **argv){
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] =
        { 
        int option_index = 0;
        static struct option long_options[] =
        { 
@@ -401,7 +400,6 @@ int process_arguments(int argc, char **argv){
                {"help",     no_argument,      0,'h'},
                {0,0,0,0}
        };
                {"help",     no_argument,      0,'h'},
                {0,0,0,0}
        };
-#endif
 
        /* no options were supplied */
        if(argc<2) return ERROR;
 
        /* no options were supplied */
        if(argc<2) return ERROR;
@@ -424,11 +422,7 @@ int process_arguments(int argc, char **argv){
        }
 
        while (1){
        }
 
        while (1){
-#ifdef HAVE_GETOPT_H
                c = getopt_long(argc,argv,"+hVH:t:c:w:p:v:l:s:d:",long_options,&option_index);
                c = getopt_long(argc,argv,"+hVH:t:c:w:p:v:l:s:d:",long_options,&option_index);
-#else
-               c = getopt(argc,argv,"+hVH:t:c:w:p:v:l:s:d:");
-#endif
 
                if (c==-1||c==EOF||c==1)
                        break;
 
                if (c==-1||c==EOF||c==1)
                        break;
index 2f7ecc107cadb5400b634b9b0d555d034502a54e..100be12f9aa9f41e78e3e5d7e8422e472b272499 100644 (file)
@@ -622,7 +622,6 @@ int main(int argc, char **argv){
 int process_arguments(int argc, char **argv){
        int c;
 
 int process_arguments(int argc, char **argv){
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] =
        { 
        int option_index = 0;
        static struct option long_options[] =
        { 
@@ -637,7 +636,6 @@ int process_arguments(int argc, char **argv){
                {"help",     no_argument,      0,'h'},
                {0,0,0,0}
        };
                {"help",     no_argument,      0,'h'},
                {0,0,0,0}
        };
-#endif
 
        /* no options were supplied */
        if(argc<2) return ERROR;
 
        /* no options were supplied */
        if(argc<2) return ERROR;
@@ -660,11 +658,7 @@ int process_arguments(int argc, char **argv){
        }
 
        while (1){
        }
 
        while (1){
-#ifdef HAVE_GETOPT_H
                c = getopt_long(argc,argv,"+hoVH:t:c:w:p:v:",long_options,&option_index);
                c = getopt_long(argc,argv,"+hoVH:t:c:w:p:v:",long_options,&option_index);
-#else
-               c = getopt(argc,argv,"+hoVH:t:c:w:p:v:");
-#endif
 
                if (c==-1||c==EOF||c==1)
                        break;
 
                if (c==-1||c==EOF||c==1)
                        break;
@@ -797,13 +791,8 @@ void print_usage(void)
        printf
                ("Usage:\n"
                 " %s %s\n"
        printf
                ("Usage:\n"
                 " %s %s\n"
-#ifdef HAVE_GETOPT_H
                 " %s (-h | --help) for detailed help\n"
                 " %s (-V | --version) for version information\n",
                 " %s (-h | --help) for detailed help\n"
                 " %s (-V | --version) for version information\n",
-#else
-                " %s -h for detailed help\n"
-                " %s -V for version information\n",
-#endif
                 progname, OPTIONS, progname, progname);
 }
 
                 progname, OPTIONS, progname, progname);
 }
 
index 2ff37a485b1741fdd8695e08d79d62c40dd4a694..4c3b957f3a5f040637134ba1d2b6f441d1bac65b 100644 (file)
@@ -317,7 +317,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"port", required_argument, 0, 'p'},
        int option_index = 0;
        static struct option long_options[] = {
                {"port", required_argument, 0, 'p'},
@@ -330,7 +329,6 @@ process_arguments (int argc, char **argv)
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
-#endif
 
        /* no options were supplied */
        if (argc < 2)
 
        /* no options were supplied */
        if (argc < 2)
@@ -354,13 +352,8 @@ process_arguments (int argc, char **argv)
        }
 
        while (1) {
        }
 
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c =
-                       getopt_long (argc, argv, "+hVH:t:c:w:p:v:", long_options,
+               c = getopt_long (argc, argv, "+hVH:t:c:w:p:v:", long_options,
                                                                         &option_index);
                                                                         &option_index);
-#else
-               c = getopt (argc, argv, "+hVH:t:c:w:p:v:");
-#endif
 
                if (c == -1 || c == EOF || c == 1)
                        break;
 
                if (c == -1 || c == EOF || c == 1)
                        break;
index 2033b8c19af42b0370d2b51471cb6b1ae1ebe37e..e1484566328961e69b89652e19f6e9ff53c7f6ef 100644 (file)
@@ -246,7 +246,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"help", no_argument, 0, 'h'},
        int option_index = 0;
        static struct option long_options[] = {
                {"help", no_argument, 0, 'h'},
@@ -262,15 +261,11 @@ process_arguments (int argc, char **argv)
                {"database", required_argument, 0, 'd'},
                {0, 0, 0, 0}
        };
                {"database", required_argument, 0, 'd'},
                {0, 0, 0, 0}
        };
-#endif
 
        while (1) {
 
        while (1) {
-#ifdef HAVE_GETOPT_H
                c = getopt_long (argc, argv, "hVt:c:w:H:P:d:l:p:a:",
                                 long_options, &option_index);
                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;
 
                if (c == EOF)
                        break;
 
index 480f631e373439d9aa6c0ac1764c8dad077f30b8..2526a74f451aa8037fae927d5fb0093e856890a6 100644 (file)
@@ -162,7 +162,6 @@ process_arguments (int argc, char **argv)
        int c = 1;
        char *ptr;
 
        int c = 1;
        char *ptr;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                STD_LONG_OPTS,
        int option_index = 0;
        static struct option long_options[] = {
                STD_LONG_OPTS,
@@ -171,9 +170,6 @@ process_arguments (int argc, char **argv)
                {"link", no_argument, 0, 'L'},
                {0, 0, 0, 0}
        };
                {"link", no_argument, 0, 'L'},
                {0, 0, 0, 0}
        };
-#endif
-
-#define OPTCHARS "VvhnLt:c:w:H:p:"
 
        if (argc < 2)
                return ERROR;
 
        if (argc < 2)
                return ERROR;
@@ -186,11 +182,8 @@ process_arguments (int argc, char **argv)
        }
 
        while (1) {
        }
 
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c = getopt_long (argc, argv, OPTCHARS, long_options, &option_index);
-#else
-               c = getopt (argc, argv, OPTCHARS);
-#endif
+               c = getopt_long (argc, argv, "VvhnLt:c:w:H:p:", long_options, &option_index);
+
                if (c == -1 || c == EOF)
                        break;
 
                if (c == -1 || c == EOF)
                        break;
 
@@ -507,13 +500,8 @@ void
 print_usage (void)
 {
        printf ("Usage:\n" " %s %s\n"
 print_usage (void)
 {
        printf ("Usage:\n" " %s %s\n"
-#ifdef HAVE_GETOPT_H
                                        " %s (-h | --help) for detailed help\n"
                                        " %s (-V | --version) for version information\n",
                                        " %s (-h | --help) for detailed help\n"
                                        " %s (-V | --version) for version information\n",
-#else
-                                       " %s -h for detailed help\n"
-                                       " %s -V for version information\n",
-#endif
                                        progname, OPTIONS, progname, progname);
 }
 
                                        progname, OPTIONS, progname, progname);
 }
 
index 755ed8609814b3aefcd5dc7787bf1ea26321bc7c..ceaff958f74b8ad56589d53a1f8481a176470a1a 100644 (file)
@@ -268,7 +268,6 @@ process_arguments (int argc, char **argv)
        int c = 1;
        char *user;
        struct passwd *pw;
        int c = 1;
        char *user;
        struct passwd *pw;
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"warning", required_argument, 0, 'w'},
        int option_index = 0;
        static struct option long_options[] = {
                {"warning", required_argument, 0, 'w'},
@@ -283,18 +282,14 @@ process_arguments (int argc, char **argv)
                {"verbose", no_argument, 0, 'v'},
                {0, 0, 0, 0}
        };
                {"verbose", no_argument, 0, 'v'},
                {0, 0, 0, 0}
        };
-#endif
 
        for (c = 1; c < argc; c++)
                if (strcmp ("-to", argv[c]) == 0)
                        strcpy (argv[c], "-t");
 
        while (1) {
 
        for (c = 1; c < argc; c++)
                if (strcmp ("-to", argv[c]) == 0)
                        strcpy (argv[c], "-t");
 
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c =     getopt_long (argc, argv, "Vvht:c:w:p:s:u:C:a:", long_options, &option_index);
-#else
-               c = getopt (argc, argv, "Vvht:c:w:p:s:u:C:a:");
-#endif
+               c = getopt_long (argc, argv, "Vvht:c:w:p:s:u:C:a:", long_options, &option_index);
+
                if (c == -1 || c == EOF)
                        break;
 
                if (c == -1 || c == EOF)
                        break;
 
index 0b338c2b2330e80a9309a926bb5fcfc64177f6e7..c71f3b4c37772de2d345c5c065568b77fec53d5b 100644 (file)
@@ -208,7 +208,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
@@ -224,7 +223,6 @@ process_arguments (int argc, char **argv)
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                return ERROR;
 
        if (argc < 2)
                return ERROR;
@@ -251,13 +249,8 @@ process_arguments (int argc, char **argv)
        }
 
        while (1) {
        }
 
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c =
-                       getopt_long (argc, argv, "+hVvH:P:F:u:p:t:r:e:", long_options,
+               c = getopt_long (argc, argv, "+hVvH:P:F:u:p:t:r:e:", long_options,
                                                                         &option_index);
                                                                         &option_index);
-#else
-               c = getopt (argc, argv, "+hVvH:P:F:u:p:t:r:e:");
-#endif
 
                if (c == -1 || c == EOF || c == 1)
                        break;
 
                if (c == -1 || c == EOF || c == 1)
                        break;
@@ -340,12 +333,7 @@ void
 print_usage (void)
 {
        printf ("Usage:\n" " %s %s\n"
 print_usage (void)
 {
        printf ("Usage:\n" " %s %s\n"
-#ifdef HAVE_GETOPT_H
                                        " %s (-h | --help) for detailed help\n"
                                        " %s (-V | --version) for version information\n",
                                        " %s (-h | --help) for detailed help\n"
                                        " %s (-V | --version) for version information\n",
-#else
-                                       " %s -h for detailed help\n"
-                                       " %s -V for version information\n",
-#endif
                                        progname, OPTIONS, progname, progname);
 }
                                        progname, OPTIONS, progname, progname);
 }
index ef3581b9508a361d63255c017caa363eec88b3c7..6b484eac30544b59484c21b7983b7fe67cdbc576 100644 (file)
@@ -274,7 +274,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
@@ -290,7 +289,6 @@ process_arguments (int argc, char **argv)
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                return ERROR;
 
        if (argc < 2)
                return ERROR;
@@ -305,13 +303,8 @@ process_arguments (int argc, char **argv)
        }
 
        while (1) {
        }
 
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c =
-                       getopt_long (argc, argv, "+hVI:H:e:u:p:w:c:t:", long_options,
+               c = getopt_long (argc, argv, "+hVI:H:e:u:p:w:c:t:", long_options,
                                                                         &option_index);
                                                                         &option_index);
-#else
-               c = getopt (argc, argv, "+?hVI:H:e:u:p:w:c:t");
-#endif
 
                if (c == -1 || c == EOF)
                        break;
 
                if (c == -1 || c == EOF)
                        break;
index f78d1126521ac20c7faf09725e2407fb192cdd4a..5e980bcc72e1545e2d2528f9fcf1ebdcb2ac49b8 100644 (file)
@@ -192,7 +192,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
@@ -206,7 +205,6 @@ process_arguments (int argc, char **argv)
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                return ERROR;
 
        if (argc < 2)
                return ERROR;
@@ -221,13 +219,9 @@ process_arguments (int argc, char **argv)
        }
 
        while (1) {
        }
 
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c =
-                       getopt_long (argc, argv, "+hVvt:p:f:e:c:w:H:", long_options,
+               c = getopt_long (argc, argv, "+hVvt:p:f:e:c:w:H:", long_options,
                                                                         &option_index);
                                                                         &option_index);
-#else
-               c = getopt (argc, argv, "+?hVvt:p:f:e:c:w:H:");
-#endif
+
                if (c == -1 || c == EOF)
                        break;
 
                if (c == -1 || c == EOF)
                        break;
 
index 327ef8181ca710a1d12053b6dee9da8583568602..b943379d4770bbc67d220ec258c9d6019f5abd9f 100644 (file)
@@ -422,7 +422,6 @@ process_arguments (int argc, char **argv)
        int c = 1;
        int j = 0, jj = 0, ii = 0;
 
        int c = 1;
        int j = 0, jj = 0, ii = 0;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                STD_LONG_OPTS,
        int option_index = 0;
        static struct option long_options[] = {
                STD_LONG_OPTS,
@@ -447,7 +446,6 @@ process_arguments (int argc, char **argv)
                {"privpasswd", required_argument, 0, 'X'},
                {0, 0, 0, 0}
        };
                {"privpasswd", required_argument, 0, 'X'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                return ERROR;
 
        if (argc < 2)
                return ERROR;
@@ -463,13 +461,8 @@ process_arguments (int argc, char **argv)
        }
 
        while (1) {
        }
 
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c =
-                       getopt_long (argc, argv, "hvVt:c:w:H:C:o:e:E:d:D:s:R:r:l:u:p:m:P:L:U:a:A:X:",
+               c = getopt_long (argc, argv, "hvVt:c:w:H:C:o:e:E:d:D:s:R:r:l:u:p:m:P:L:U:a:A:X:",
                                                                         long_options, &option_index);
                                                                         long_options, &option_index);
-#else
-               c = getopt (argc, argv, "hvVt:c:w:H:C:o:e:E:d:D:s:R:r:l:u:p:m:P:L:U:a:A:X:");
-#endif
 
                if (c == -1 || c == EOF)
                        break;
 
                if (c == -1 || c == EOF)
                        break;
index bd0a2451a44a9ec54d2c973ba378c75c9364e5b2..f3a351e6800d82dd24b608705c76bc4501cf7936 100644 (file)
@@ -64,7 +64,6 @@ process_arguments (int argc, char **argv)
        int c;
        char *tmp = NULL;
 
        int c;
        char *tmp = NULL;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"version", no_argument, 0, 'V'},
        int option_index = 0;
        static struct option long_options[] = {
                {"version", no_argument, 0, 'V'},
@@ -74,7 +73,6 @@ process_arguments (int argc, char **argv)
                {"host", required_argument, 0, 'H'},
                {0, 0, 0, 0}
        };
                {"host", required_argument, 0, 'H'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                return ERROR;
 
        if (argc < 2)
                return ERROR;
@@ -84,11 +82,8 @@ process_arguments (int argc, char **argv)
                        strcpy (argv[c], "-t");
 
        while (1) {
                        strcpy (argv[c], "-t");
 
        while (1) {
-#ifdef HAVE_GETOPT_H
                c = getopt_long (argc, argv, "+Vhvt:H:p:", long_options, &option_index);
                c = getopt_long (argc, argv, "+Vhvt:H:p:", long_options, &option_index);
-#else
-               c = getopt (argc, argv, "+Vhvt:H:p:");
-#endif
+
                if (c == -1 || c == EOF)
                        break;
 
                if (c == -1 || c == EOF)
                        break;
 
index 5645779d622fa325bb2eae368af413e138686379..ad5eb25ff972912a00d827de3267183b8b9c7dd5 100644 (file)
@@ -198,7 +198,6 @@ process_arguments (int argc, char **argv)
        int wc = 0; /* warning counter  */
        int cc = 0; /* critical counter */
 
        int wc = 0; /* warning counter  */
        int cc = 0; /* critical counter */
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"warning", required_argument, 0, 'w'},
        int option_index = 0;
        static struct option long_options[] = {
                {"warning", required_argument, 0, 'w'},
@@ -209,17 +208,12 @@ process_arguments (int argc, char **argv)
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                return ERROR;
 
        while (1) {
 
        if (argc < 2)
                return ERROR;
 
        while (1) {
-#ifdef HAVE_GETOPT_H
                c = getopt_long (argc, argv, "+?Vvhac:w:", long_options, &option_index);
                c = getopt_long (argc, argv, "+?Vvhac:w:", long_options, &option_index);
-#else
-               c = getopt (argc, argv, "+?Vvhac:w:");
-#endif
 
                if (c == -1 || c == EOF)
                        break;
 
                if (c == -1 || c == EOF)
                        break;
index 8a2dcc5c53a14d090c7aa350f075ee64cbbaaf8d..3461c333faaf292aad3d12dccef0c71285140fee 100644 (file)
@@ -334,7 +334,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
@@ -354,7 +353,6 @@ process_arguments (int argc, char **argv)
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                usage ("No arguments found\n");
 
        if (argc < 2)
                usage ("No arguments found\n");
@@ -377,13 +375,8 @@ process_arguments (int argc, char **argv)
        }
 
        while (1) {
        }
 
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c =
-                       getopt_long (argc, argv, "+hVvH:s:e:q:c:w:t:p:C:W:d:S", long_options,
+               c = getopt_long (argc, argv, "+hVvH:s:e:q:c:w:t:p:C:W:d:S", long_options,
                                                                         &option_index);
                                                                         &option_index);
-#else
-               c = getopt (argc, argv, "+hVvH:s:e:q:c:w:t:p:C:W:d:S");
-#endif
 
                if (c == -1 || c == EOF || c == 1)
                        break;
 
                if (c == -1 || c == EOF || c == 1)
                        break;
index e4bd26d7f7fc24c5cb34eb5836d08e300dbcc07f..70bb6906d4cb5d9bcff30d09b58ac12eab2cc68f 100644 (file)
@@ -158,7 +158,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
@@ -172,7 +171,6 @@ process_arguments (int argc, char **argv)
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                usage ("\n");
 
        if (argc < 2)
                usage ("\n");
@@ -191,13 +189,8 @@ process_arguments (int argc, char **argv)
        }
 
        while (1) {
        }
 
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c =
-                       getopt_long (argc, argv, "hVH:w:c:W:C:p:t:", long_options,
+               c = getopt_long (argc, argv, "hVH:w:c:W:C:p:t:", long_options,
                                                                         &option_index);
                                                                         &option_index);
-#else
-               c = getopt (argc, argv, "hVH:w:c:W:C:p:t:");
-#endif
 
                if (c == -1 || c == EOF)
                        break;
 
                if (c == -1 || c == EOF)
                        break;
index 4ae9c1036319f96a732df3e401b6f7a4c16e7104..ac2210257d4f32d422fe2794b6a16063f89237f6 100644 (file)
@@ -125,7 +125,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
@@ -140,7 +139,6 @@ process_arguments (int argc, char **argv)
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                usage ("\n");
 
        if (argc < 2)
                usage ("\n");
@@ -155,11 +153,7 @@ process_arguments (int argc, char **argv)
        }
 
        while (1) {
        }
 
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c =     getopt_long (argc, argv, "+hVvH:e:s:c:w:t:p:", long_options, &option_index);
-#else
-               c = getopt (argc, argv, "+hVvH:e:s:c:w:t:p:");
-#endif
+               c = getopt_long (argc, argv, "+hVvH:e:s:c:w:t:p:", long_options, &option_index);
 
                if (c == -1 || c == EOF || c == 1)
                        break;
 
                if (c == -1 || c == EOF || c == 1)
                        break;
index 4c9032268f8a940e4cefd758aefd1269dae4e78b..b077d31fe607bfbadb3171f8b16be4d58e3abfc5 100644 (file)
@@ -434,7 +434,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
        int option_index = 0;
        static struct option long_options[] = {
                {"hostname", required_argument, 0, 'H'},
@@ -448,7 +447,6 @@ process_arguments (int argc, char **argv)
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                return ERROR;
 
        if (argc < 2)
                return ERROR;
@@ -463,13 +461,8 @@ process_arguments (int argc, char **argv)
        }
 
        while (1) {
        }
 
        while (1) {
-#ifdef HAVE_GETOPT_H
-               c =
-                       getopt_long (argc, argv, "hVH:u:p:v:c:w:t:", long_options,
+               c = getopt_long (argc, argv, "hVH:u:p:v:c:w:t:", long_options,
                                                                         &option_index);
                                                                         &option_index);
-#else
-               c = getopt (argc, argv, "hVH:u:p:v:c:w:t:");
-#endif
 
                if (c == -1 || c == EOF)
                        break;
 
                if (c == -1 || c == EOF)
                        break;
index 565d9e7032ca1ac7c0e196a2c06a83ff526d53e2..58e8c13b10374ce8a7e05ebf740c533b8b9e2843 100644 (file)
@@ -136,7 +136,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"critical", required_argument, 0, 'c'},
        int option_index = 0;
        static struct option long_options[] = {
                {"critical", required_argument, 0, 'c'},
@@ -145,17 +144,12 @@ process_arguments (int argc, char **argv)
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
                {"help", no_argument, 0, 'h'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                usage ("\n");
 
        while (1) {
 
        if (argc < 2)
                usage ("\n");
 
        while (1) {
-#ifdef HAVE_GETOPT_H
                c = getopt_long (argc, argv, "+hVvc:w:", long_options, &option_index);
                c = getopt_long (argc, argv, "+hVvc:w:", long_options, &option_index);
-#else
-               c = getopt (argc, argv, "+hVvc:w:");
-#endif
 
                if (c == -1 || c == EOF || c == 1)
                        break;
 
                if (c == -1 || c == EOF || c == 1)
                        break;
index e6132a0f5836725c3496d45558434ecebc9caee6..7a9acb2dfea05021b6fa639f56a90f5bdfe7264e 100644 (file)
@@ -140,7 +140,6 @@ process_arguments (int argc, char **argv)
 {
        int c;
 
 {
        int c;
 
-#ifdef HAVE_GETOPT_H
        int option_index = 0;
        static struct option long_options[] = {
                {"help", no_argument, 0, 'h'},
        int option_index = 0;
        static struct option long_options[] = {
                {"help", no_argument, 0, 'h'},
@@ -150,17 +149,13 @@ process_arguments (int argc, char **argv)
                {"command", required_argument, 0, 'C'},
                {0, 0, 0, 0}
        };
                {"command", required_argument, 0, 'C'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                return ERROR;
 
        while (1) {
 
        if (argc < 2)
                return ERROR;
 
        while (1) {
-#ifdef HAVE_GETOPT_H
                c = getopt_long (argc, argv, "+hVc:w:C:", long_options, &option_index);
                c = getopt_long (argc, argv, "+hVc:w:C:", long_options, &option_index);
-#else
-               c = getopt (argc, argv, "+hVc:w:C:");
-#endif
+
                if (c == EOF)
                        break;
 
                if (c == EOF)
                        break;