diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/utils_base.c | 2 | ||||
| -rw-r--r-- | lib/utils_base.h | 2 | ||||
| -rw-r--r-- | lib/utils_cmd.c | 3 |
3 files changed, 3 insertions, 4 deletions
diff --git a/lib/utils_base.c b/lib/utils_base.c index f86efbeb..f8592f41 100644 --- a/lib/utils_base.c +++ b/lib/utils_base.c | |||
| @@ -37,7 +37,7 @@ | |||
| 37 | 37 | ||
| 38 | monitoring_plugin *this_monitoring_plugin=NULL; | 38 | monitoring_plugin *this_monitoring_plugin=NULL; |
| 39 | 39 | ||
| 40 | unsigned int timeout_state = STATE_CRITICAL; | 40 | int timeout_state = STATE_CRITICAL; |
| 41 | unsigned int timeout_interval = DEFAULT_SOCKET_TIMEOUT; | 41 | unsigned int timeout_interval = DEFAULT_SOCKET_TIMEOUT; |
| 42 | 42 | ||
| 43 | bool _np_state_read_file(FILE *); | 43 | bool _np_state_read_file(FILE *); |
diff --git a/lib/utils_base.h b/lib/utils_base.h index 80b87435..9d4dffed 100644 --- a/lib/utils_base.h +++ b/lib/utils_base.h | |||
| @@ -65,7 +65,7 @@ bool check_range(double, range *); | |||
| 65 | int get_status(double, thresholds *); | 65 | int get_status(double, thresholds *); |
| 66 | 66 | ||
| 67 | /* Handle timeouts */ | 67 | /* Handle timeouts */ |
| 68 | extern unsigned int timeout_state; | 68 | extern int timeout_state; |
| 69 | extern unsigned int timeout_interval; | 69 | extern unsigned int timeout_interval; |
| 70 | 70 | ||
| 71 | /* All possible characters in a threshold range */ | 71 | /* All possible characters in a threshold range */ |
diff --git a/lib/utils_cmd.c b/lib/utils_cmd.c index cfb2073c..7957ec14 100644 --- a/lib/utils_cmd.c +++ b/lib/utils_cmd.c | |||
| @@ -390,13 +390,12 @@ cmd_file_read ( char *filename, output *out, int flags) | |||
| 390 | void | 390 | void |
| 391 | timeout_alarm_handler (int signo) | 391 | timeout_alarm_handler (int signo) |
| 392 | { | 392 | { |
| 393 | size_t i; | ||
| 394 | if (signo == SIGALRM) { | 393 | if (signo == SIGALRM) { |
| 395 | printf (_("%s - Plugin timed out after %d seconds\n"), | 394 | printf (_("%s - Plugin timed out after %d seconds\n"), |
| 396 | state_text(timeout_state), timeout_interval); | 395 | state_text(timeout_state), timeout_interval); |
| 397 | 396 | ||
| 398 | long maxfd = mp_open_max(); | 397 | long maxfd = mp_open_max(); |
| 399 | if(_cmd_pids) for(i = 0; i < maxfd; i++) { | 398 | if(_cmd_pids) for(long int i = 0; i < maxfd; i++) { |
| 400 | if(_cmd_pids[i] != 0) kill(_cmd_pids[i], SIGKILL); | 399 | if(_cmd_pids[i] != 0) kill(_cmd_pids[i], SIGKILL); |
| 401 | } | 400 | } |
| 402 | 401 | ||
