summaryrefslogtreecommitdiffstats
path: root/sysutils/asapm/files/patch-apm_read.c
blob: 46bd02a86bb7b01b867a53be4b14fc3bf1dea2a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
--- apm_read.c.orig	Wed Jul 27 08:23:06 2005
+++ apm_read.c	Wed Jul 27 23:15:33 2005
@@ -413,6 +413,9 @@
 	unsigned int remaining_capacity = 0;
 	unsigned int present_rate = 0;
 
+	unsigned int percent;
+	unsigned int time_left;
+
 	if ( ! acpi_available )
 		return -1;
 
@@ -617,7 +620,7 @@
 	 * Calculate the percentage and time to full charge
 	 * or discharge based on the reported rate.
 	 */
-	unsigned int percent = 
+	percent = 
 		last_full_capacity ?
 		(float)remaining_capacity / (float)last_full_capacity * 100
 		: 0;
@@ -626,7 +629,6 @@
 		++state.update;
 	}
 
-	unsigned int time_left;
 	if ( state.battery_status == BATTERY_CHARGING ) {
 		time_left = 
 			present_rate ?
OpenPOWER on IntegriCloud