FreeBSD: Fix

This commit is contained in:
Alastair Poole 2020-04-28 19:21:41 +01:00
parent ba22c1c4fd
commit 41a8e8b7ca
1 changed files with 4 additions and 1 deletions

View File

@ -899,7 +899,10 @@ _battery_state_get(power_t *power)
battio.unit = i;
if (ioctl(fd, ACPIIO_BATT_GET_BIF, &battio) != -1)
{
power->batteries[i]->charge_full = battio.bif.dcap;
if (battio.bif.lfcap == 0)
power->batteries[i]->charge_full = battio.bif.dcap;
else
power->batteries[i]->charge_full = battio.bif.lfcap;
}
snprintf(name, sizeof(name), "%s %s", battio.bif.oeminfo, battio.bif.model);
power->battery_names[i] = strdup(name);