netstar pushed a commit to branch master.

http://git.enlightenment.org/apps/evisum.git/commit/?id=41a8e8b7ca911448c0c4f6a0a960aba961afd36c

commit 41a8e8b7ca911448c0c4f6a0a960aba961afd36c
Author: Alastair Poole <[email protected]>
Date:   Tue Apr 28 19:21:41 2020 +0100

    FreeBSD: Fix
---
 src/bin/system.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/bin/system.c b/src/bin/system.c
index 8445ab2..3a3d46f 100644
--- a/src/bin/system.c
+++ b/src/bin/system.c
@@ -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);

-- 


Reply via email to