From 07f9c438f31de7a280e43c4196a32d200ad41fbe Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Thu, 19 Oct 2023 12:10:55 +0200 Subject: Fixes for -Wsign-compare --- lib/utils_base.c | 2 +- lib/utils_base.h | 2 +- lib/utils_cmd.c | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) (limited to 'lib') 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 @@ monitoring_plugin *this_monitoring_plugin=NULL; -unsigned int timeout_state = STATE_CRITICAL; +int timeout_state = STATE_CRITICAL; unsigned int timeout_interval = DEFAULT_SOCKET_TIMEOUT; 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 *); int get_status(double, thresholds *); /* Handle timeouts */ -extern unsigned int timeout_state; +extern int timeout_state; extern unsigned int timeout_interval; /* 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) void timeout_alarm_handler (int signo) { - size_t i; if (signo == SIGALRM) { printf (_("%s - Plugin timed out after %d seconds\n"), state_text(timeout_state), timeout_interval); long maxfd = mp_open_max(); - if(_cmd_pids) for(i = 0; i < maxfd; i++) { + if(_cmd_pids) for(long int i = 0; i < maxfd; i++) { if(_cmd_pids[i] != 0) kill(_cmd_pids[i], SIGKILL); } -- cgit v1.2.3-74-g34f1