X-Git-Url: https://git.xinqibao.xyz/slstatus.git/blobdiff_plain/7be675f154e3922fb8e2c9309b48f9fa12869817..fc8b6f81a54810faa844ea21d08ef47f95b8f4e0:/components/battery.c?ds=inline diff --git a/components/battery.c b/components/battery.c index 0871953..4c6b4f5 100644 --- a/components/battery.c +++ b/components/battery.c @@ -52,11 +52,13 @@ #include const char * - battery_perc(const char *null) + battery_perc(const char *bat) { struct apm_power_info apm_info; int fd; + UNUSED(bat); /* no way to specify battery on OpenBSD */ + fd = open("/dev/apm", O_RDONLY); if (fd < 0) { fprintf(stderr, "open '/dev/apm': %s\n", strerror(errno)); @@ -77,7 +79,8 @@ const char * battery_state(const char *bat) { - int fd, i; + int fd; + size_t i; struct apm_power_info apm_info; struct { unsigned int state; @@ -87,6 +90,8 @@ { APM_AC_OFF, "-" }, }; + UNUSED(bat); /* no way to specify battery on OpenBSD */ + fd = open("/dev/apm", O_RDONLY); if (fd < 0) { fprintf(stderr, "open '/dev/apm': %s\n", strerror(errno));