From 6f2d545244193432a6ad3d54185628b8f6a6091e Mon Sep 17 00:00:00 2001 From: Thomas Guyot-Sionnest Date: Wed, 29 Jan 2014 01:41:23 -0500 Subject: Fix check_swap returning OK on & thresholds and no swap Return 0% free instead of 100% free when total swap is 0 --- plugins/check_swap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/check_swap.c b/plugins/check_swap.c index ce510e14..04256adf 100644 --- a/plugins/check_swap.c +++ b/plugins/check_swap.c @@ -350,7 +350,7 @@ main (int argc, char **argv) if(total_swap_mb) { percent_used = 100 * ((double) used_swap_mb) / ((double) total_swap_mb); } else { - percent_used = 0; + percent_used = 100; } result = max_state (result, check_swap (percent_used, free_swap_mb)); -- cgit v1.2.3-74-g34f1