diff --git a/plugins/check_mrtg.c b/plugins/check_mrtg.c
index 80c9b00894bd2b0766aad18214a11ed5482bf64d..095dcbc8ccd63200145e98532f20a3786cdb71b4 100644 (file)
--- a/plugins/check_mrtg.c
+++ b/plugins/check_mrtg.c
*
*****************************************************************************/
-#define PROGNAME "check_mrtg"
+const char *progname = "check_mrtg";
#define REVISION "$Revision$"
#define COPYRIGHT "Copyright (c) 1999-2001 Ethan Galstad"
{
int c;
-#ifdef HAVE_GETOPT_H
int option_index = 0;
static struct option long_options[] = {
{"logfile", required_argument, 0, 'F'},
{"help", no_argument, 0, 'h'},
{0, 0, 0, 0}
};
-#endif
if (argc < 2)
return ERROR;
}
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);
-#else
- c = getopt (argc, argv, "hVF:e:a:v:c:w:l:u:");
-#endif
if (c == -1 || c == EOF)
break;
units_label = optarg;
break;
case 'V': /* version */
- print_revision (PROGNAME, REVISION);
+ print_revision (progname, REVISION);
exit (STATE_OK);
case 'h': /* help */
print_help ();
else
terminate (STATE_UNKNOWN,
"%s is not a valid expiration time\nUse '%s -h' for additional help\n",
- argv[c], PROGNAME);
+ argv[c], progname);
}
if (argc > c && strcmp (argv[c], "MAX") == 0) {
void
print_help (void)
{
- print_revision (PROGNAME, REVISION);
+ print_revision (progname, REVISION);
printf ("%s\n\n%s\n", COPYRIGHT, SUMMARY);
print_usage ();
printf ("\nOptions:\n" LONGOPTIONS "\n" DESCRIPTION "\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",
-#else
- " %s -h for detailed help\n"
- " %s -V for version information\n",
-#endif
- PROGNAME, OPTIONS, PROGNAME, PROGNAME);
+ progname, OPTIONS, progname, progname);
}