Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 11731
b: refs/heads/master
c: 08124f9
h: refs/heads/master
i:
  11729: 1416627
  11727: 3338008
v: v3
  • Loading branch information
Olaf Hering authored and Paul Mackerras committed Oct 29, 2005
1 parent b524351 commit 7b9b55d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7e658118faa9faf71f8a8295cdaeb7ca71c04672
refs/heads/master: 08124f958997ac14bb2284af787752125a892e9f
8 changes: 6 additions & 2 deletions trunk/drivers/macintosh/apm_emu.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,8 +430,8 @@ static int apm_emu_get_info(char *buf, char **start, off_t fpos, int length)
-1: Unknown
8) min = minutes; sec = seconds */

unsigned short ac_line_status = 0xff;
unsigned short battery_status = 0xff;
unsigned short ac_line_status;
unsigned short battery_status = 0;
unsigned short battery_flag = 0xff;
int percentage = -1;
int time_units = -1;
Expand All @@ -446,6 +446,7 @@ static int apm_emu_get_info(char *buf, char **start, off_t fpos, int length)
ac_line_status = ((pmu_power_flags & PMU_PWR_AC_PRESENT) != 0);
for (i=0; i<pmu_battery_count; i++) {
if (pmu_batteries[i].flags & PMU_BATT_PRESENT) {
battery_status++;
if (percentage < 0)
percentage = 0;
if (charge < 0)
Expand All @@ -461,6 +462,9 @@ static int apm_emu_get_info(char *buf, char **start, off_t fpos, int length)
charging++;
}
}
if (0 == battery_status)
ac_line_status = 1;
battery_status = 0xff;
if (real_count) {
if (amperage < 0) {
if (btype == PMU_BATT_TYPE_SMART)
Expand Down

0 comments on commit 7b9b55d

Please sign in to comment.