Explorar el Código

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 hace 12 años
padre
commit
6f2d545244
Se han modificado 1 ficheros con 1 adiciones y 1 borrados
  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));