diff --git a/plugins/check_udp.c b/plugins/check_udp.c
index 4074d948453f9628e3120337ec19945e3fb39c14..da9a142027e3e5876bbe052f8a4915fef34826a0 100644 (file)
--- a/plugins/check_udp.c
+++ b/plugins/check_udp.c
alarm (socket_timeout);
time (&start_time);
alarm (socket_timeout);
time (&start_time);
- result =
- process_udp_request (server_address, server_port, server_send,
- recv_buffer, MAX_INPUT_BUFFER - 1);
+ result = process_udp_request (server_address, server_port, server_send,
+ recv_buffer, MAX_INPUT_BUFFER - 1);
time (&end_time);
if (result != STATE_OK) {
time (&end_time);
if (result != STATE_OK) {
{
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'},
{"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");
}
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;
usage ("Invalid host name/address\n");
server_address = argv[c++];
}
usage ("Invalid host name/address\n");
server_address = argv[c++];
}
- else {
+
+ if (server_address == NULL)
usage ("Host name was not supplied\n");
usage ("Host name was not supplied\n");
- }
return c;
}
return c;
}