4
0
Эх сурвалжийг харах

Fix check_swap returning OK on & thresholds and no swap

Return 0% free instead of 100% free when total swap is 0
Thomas Guyot-Sionnest 12 жил өмнө
parent
commit
6f2d545244
1 өөрчлөгдсөн 1 нэмэгдсэн , 1 устгасан
  1. 1 1
      plugins/check_swap.c

+ 1 - 1
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));