MFC 1.18: Fix for 99% being reported instead of 100% when one battery

is missing.

Approved by:	re (kensmith)
This commit is contained in:
njl 2005-08-12 17:29:58 +00:00
parent 1658d65505
commit 10f961b659

View File

@ -225,7 +225,10 @@ acpi_battery_get_battinfo(device_t dev, struct acpi_battinfo *battinfo)
else
bi[i].min = 0;
total_min += bi[i].min;
total_cap += bi[i].cap;
/* If this battery is not present, don't use its capacity. */
if (bi[i].cap != -1)
total_cap += bi[i].cap;
}
/*