From c568ad207c7284f301120698d20aec57ed4f24f6 Mon Sep 17 00:00:00 2001 From: RincewindsHat <12514511+RincewindsHat@users.noreply.github.com> Date: Mon, 9 Oct 2023 01:31:52 +0200 Subject: Remove preprocessor macro diff --git a/plugins-root/check_icmp.c b/plugins-root/check_icmp.c index 39ca302..5a9485d 100644 --- a/plugins-root/check_icmp.c +++ b/plugins-root/check_icmp.c @@ -1354,7 +1354,6 @@ finish(int sig) pl_mode = true; } -#define THIS_STATUS_WARNING this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status) /* Check which mode is on and do the warn / Crit stuff */ if (rta_mode) { if(rta >= crit.rta) { @@ -1362,7 +1361,7 @@ finish(int sig) status = STATE_CRITICAL; host->rta_status=STATE_CRITICAL; } else if(status!=STATE_CRITICAL && (rta >= warn.rta)) { - THIS_STATUS_WARNING; + this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status) status = STATE_WARNING; host->rta_status=STATE_WARNING; } @@ -1374,7 +1373,7 @@ finish(int sig) status = STATE_CRITICAL; host->pl_status=STATE_CRITICAL; } else if(status!=STATE_CRITICAL && (pl >= warn.pl)) { - THIS_STATUS_WARNING; + this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status) status = STATE_WARNING; host->pl_status=STATE_WARNING; } @@ -1386,7 +1385,7 @@ finish(int sig) status = STATE_CRITICAL; host->jitter_status=STATE_CRITICAL; } else if(status!=STATE_CRITICAL && (host->jitter >= warn.jitter)) { - THIS_STATUS_WARNING; + this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status) status = STATE_WARNING; host->jitter_status=STATE_WARNING; } @@ -1398,7 +1397,7 @@ finish(int sig) status = STATE_CRITICAL; host->mos_status=STATE_CRITICAL; } else if(status!=STATE_CRITICAL && (host->mos <= warn.mos)) { - THIS_STATUS_WARNING; + this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status) status = STATE_WARNING; host->mos_status=STATE_WARNING; } @@ -1410,7 +1409,7 @@ finish(int sig) status = STATE_CRITICAL; host->score_status=STATE_CRITICAL; } else if(status!=STATE_CRITICAL && (host->score <= warn.score)) { - THIS_STATUS_WARNING; + this_status = (this_status <= STATE_WARNING ? STATE_WARNING : this_status) status = STATE_WARNING; host->score_status=STATE_WARNING; } -- cgit v0.10-9-g596f