From 41367d9625c1d8a854bdeef4c09511ad4d93b192 Mon Sep 17 00:00:00 2001 From: Karl DeBisschop Date: Tue, 12 Nov 2002 11:26:01 +0000 Subject: remove call_getopt git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@188 f882894a-f735-0410-b71e-b25c423dba1c --- plugins/check_ups.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'plugins/check_ups.c') diff --git a/plugins/check_ups.c b/plugins/check_ups.c index c711de20..e250ef9d 100644 --- a/plugins/check_ups.c +++ b/plugins/check_ups.c @@ -82,7 +82,7 @@ #define UPSSTATUS_UNKOWN 32 int server_port = PORT; -char *server_address = NULL; +char *server_address = "127.0.0.1"; char *ups_name = NULL; double warning_value = 0.0L; double critical_value = 0.0L; @@ -103,7 +103,6 @@ int determine_supported_vars (void); int get_ups_variable (const char *, char *, int); int process_arguments (int, char **); -int call_getopt (int, char **); int validate_arguments (void); void print_help (void); void print_usage (void); @@ -547,17 +546,13 @@ process_arguments (int argc, char **argv) } - if (server_address == NULL) { - if (optind >= argc) { - server_address = strscpy (NULL, "127.0.0.1"); - } - else if (is_host (argv[optind])) { + if (server_address == NULL && argc > optind) { + if (is_host (argv[optind])) server_address = argv[optind++]; - } - else { + else usage ("Invalid host name"); - } } + return validate_arguments(); } -- cgit v1.2.3-74-g34f1