Jelajahi Sumber

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 tahun lalu
induk
melakukan
6f2d545244
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  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));