From f3147ea2d1598914c2db53e8cfb34c8ff81e2ff4 Mon Sep 17 00:00:00 2001 From: Daniel Lange Date: Thu, 27 Aug 2020 07:48:10 +0200 Subject: New upstream version 3.0.0 --- openbsd/Battery.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'openbsd/Battery.c') diff --git a/openbsd/Battery.c b/openbsd/Battery.c index 3a0bae1..c215e41 100644 --- a/openbsd/Battery.c +++ b/openbsd/Battery.c @@ -10,6 +10,7 @@ in the source distribution for its full text. #include #include #include +#include static bool findDevice(const char* name, int* mib, struct sensordev* snsrdev, size_t* sdlen) { for (int devn = 0;; devn++) { @@ -34,7 +35,7 @@ void Battery_getData(double* level, ACPresence* isOnAC) { size_t sdlen = sizeof(struct sensordev); bool found = findDevice("acpibat0", mib, &snsrdev, &sdlen); - + *level = -1; if (found) { /* last full capacity */ @@ -57,9 +58,9 @@ void Battery_getData(double* level, ACPresence* isOnAC) { } } } - + found = findDevice("acpiac0", mib, &snsrdev, &sdlen); - + *isOnAC = AC_ERROR; if (found) { mib[3] = 9; -- cgit v1.2.3