hal/hald util.c,1.23,1.24

Danny Kukawka dkukawka at freedesktop.org
Sun Aug 21 09:14:29 PDT 2005


Update of /cvs/hal/hal/hald
In directory gabe:/tmp/cvs-serv18508/hald

Modified Files:
	util.c 
Log Message:
2005-08-21  Danny Kukawka <danny.kukawka at web.de>

        * hald/util.c: (util_compute_percentage_charge): Fix to return 100 for
        computed percentage values > 100% instead of -1. This can happen on
        ACPI systems wich reports temporarily a higher 'remaining capacity'
        then the 'last full capacity'.



Index: util.c
===================================================================
RCS file: /cvs/hal/hal/hald/util.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- util.c	19 Aug 2005 19:31:48 -0000	1.23
+++ util.c	21 Aug 2005 16:14:27 -0000	1.24
@@ -79,7 +79,7 @@
 	/* make sure results are sensible */
 	if (percentage > 100) {
 		HAL_WARNING (("Percentage %i, returning 100!", percentage));
-		return -1;
+		return 100;
 	}
 	if (percentage < 0) {
 		HAL_WARNING (("Percentage %i, returning -1!", percentage));




More information about the hal-commit mailing list