From 2bea8e9522af1c454d1a6a618402f9f342730406 Mon Sep 17 00:00:00 2001 From: Lorenz Kästle <12514511+RincewindsHat@users.noreply.github.com> Date: Fri, 20 Jun 2025 10:04:34 +0200 Subject: check_icmp: Remove signal handling and timeouts The timeout option was redundant in that the runtime of check_icmp was always limited by the input parameters and therefore timeout gets removed with this commit to avoid that confusion. The rest of the signal handlings was removed too, since the added complexity does not provide sufficient returns. If check_icmp gets a signal, it now dies like most other programs instead of trying to save some things and return a (arguably wrong) result. --- plugins-root/check_icmp.d/check_icmp_helpers.c | 19 ------------------- 1 file changed, 19 deletions(-) (limited to 'plugins-root/check_icmp.d/check_icmp_helpers.c') diff --git a/plugins-root/check_icmp.d/check_icmp_helpers.c b/plugins-root/check_icmp.d/check_icmp_helpers.c index 7a936cc9..ec786305 100644 --- a/plugins-root/check_icmp.d/check_icmp_helpers.c +++ b/plugins-root/check_icmp.d/check_icmp_helpers.c @@ -132,22 +132,3 @@ unsigned int ping_target_list_append(ping_target *list, ping_target *elem) { return result; } - -void check_icmp_timeout_handler(int signal, siginfo_t *info, void *ucontext) { - // Ignore unused arguments - (void)info; - (void)ucontext; - mp_subcheck timeout_sc = mp_subcheck_init(); - timeout_sc = mp_set_subcheck_state(timeout_sc, socket_timeout_state); - - if (signal == SIGALRM) { - xasprintf(&timeout_sc.output, _("timeout after %d seconds\n"), timeout); - } else { - xasprintf(&timeout_sc.output, _("timeout after %d seconds\n"), timeout); - } - - mp_check overall = mp_check_init(); - mp_add_subcheck_to_check(&overall, timeout_sc); - - mp_exit(overall); -} -- cgit v1.2.3-74-g34f1