Code

Reference to web site to get NSClient
[nagiosplug.git] / plugins / check_vsz.c
index 767abf4fd6d4d3be28dfaeaebad1cb72e879210c..7a9acb2dfea05021b6fa639f56a90f5bdfe7264e 100644 (file)
@@ -63,7 +63,7 @@ main (int argc, char **argv)
        char proc_name[MAX_INPUT_BUFFER];
        char *message = "";
 
-       if (!process_arguments (argc, argv)) {
+       if (process_arguments (argc, argv) == ERROR) {
                printf ("%s: failure parsing arguments\n", progname);
                print_help (progname);
                return STATE_UNKNOWN;
@@ -140,7 +140,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'},
@@ -150,23 +149,18 @@ process_arguments (int argc, char **argv)
                {"command", required_argument, 0, 'C'},
                {0, 0, 0, 0}
        };
-#endif
 
        if (argc < 2)
                return ERROR;
 
        while (1) {
-#ifdef HAVE_GETOPT_H
                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;
 
                switch (c) {
                case '?':                                                                       /* help */
-                       printf ("%s: Unknown argument: %s\n\n", progname, optarg);
                        print_usage (progname);
                        exit (STATE_UNKNOWN);
                case 'h':                                                                       /* help */