Line 0
Link Here
|
|
|
1 |
--- apm_read.c.orig Tue May 17 06:49:13 2005 |
2 |
+++ apm_read.c Sun May 29 20:38:24 2005 |
3 |
@@ -301,6 +301,9 @@ |
4 |
unsigned int remaining_capacity = 0; |
5 |
unsigned int present_rate = 0; |
6 |
|
7 |
+ unsigned int percent; |
8 |
+ unsigned int time_left; |
9 |
+ |
10 |
/* First check if there is an ACPI system */ |
11 |
if ((fd = open("/proc/acpi/info", O_RDONLY)) == -1) { |
12 |
error_handle(1, "open_acpi_info_file"); |
13 |
@@ -503,7 +506,7 @@ |
14 |
* Calculate the percentage and time to full charge |
15 |
* or discharge based on the reported rate. |
16 |
*/ |
17 |
- unsigned int percent = |
18 |
+ percent = |
19 |
last_full_capacity ? |
20 |
(float)remaining_capacity / (float)last_full_capacity * 100 |
21 |
: 0; |
22 |
@@ -512,7 +515,6 @@ |
23 |
++state.update; |
24 |
} |
25 |
|
26 |
- unsigned int time_left; |
27 |
if ( state.battery_status == BATTERY_CHARGING ) { |
28 |
time_left = |
29 |
present_rate ? |