FreeBSD: Fix
This commit is contained in:
parent
ba22c1c4fd
commit
41a8e8b7ca
|
@ -899,7 +899,10 @@ _battery_state_get(power_t *power)
|
||||||
battio.unit = i;
|
battio.unit = i;
|
||||||
if (ioctl(fd, ACPIIO_BATT_GET_BIF, &battio) != -1)
|
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);
|
snprintf(name, sizeof(name), "%s %s", battio.bif.oeminfo, battio.bif.model);
|
||||||
power->battery_names[i] = strdup(name);
|
power->battery_names[i] = strdup(name);
|
||||||
|
|
Loading…
Reference in New Issue