mirror of
https://github.com/opnsense/src.git
synced 2026-07-15 12:11:48 -04:00
Correct minor output bug. When the battery being queried is charging or
the overall discharge rate is 0, mark the battery remaining time as "unknown", not 0. Reported by: Eric Kjeldergaard MFC after: 4 days
This commit is contained in:
parent
336a1a7b37
commit
f4e31e2e89
1 changed files with 7 additions and 0 deletions
|
|
@ -244,6 +244,13 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_battinfo *battinfo)
|
|||
battinfo->state = bi[dev_idx].state;
|
||||
battinfo->rate = bst[dev_idx].rate;
|
||||
}
|
||||
|
||||
/*
|
||||
* If the queried battery has no discharge rate or is charging,
|
||||
* report that we don't know the remaining time.
|
||||
*/
|
||||
if (valid_rate == 0 || (battinfo->state & ACPI_BATT_STAT_CHARGING))
|
||||
battinfo->min = -1;
|
||||
} else
|
||||
acpi_reset_battinfo(battinfo);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue