tBattery read plugin only works on OpenBSD so guard it - spoon - dwm status uti… | |
git clone git://src.adamsgaard.dk/spoon | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit f1a0d8b0257f582bbff7e326c395455af4742f0f | |
parent 30aa5ecceb75531e6b68960b5d14a7d332dced2e | |
Author: sin <[email protected]> | |
Date: Sun, 15 May 2016 13:25:33 +0100 | |
Battery read plugin only works on OpenBSD so guard it | |
Diffstat: | |
M spoon.c | 16 ++++++++++++---- | |
1 file changed, 12 insertions(+), 4 deletions(-) | |
--- | |
diff --git a/spoon.c b/spoon.c | |
t@@ -1,15 +1,11 @@ | |
#include <sys/types.h> | |
-#include <sys/ioctl.h> | |
#include <err.h> | |
-#include <fcntl.h> | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <time.h> | |
-#include <machine/apmvar.h> | |
- | |
#include <X11/XKBlib.h> | |
#include <X11/extensions/XKBrules.h> | |
t@@ -48,6 +44,11 @@ mpdread(char *buf, size_t len) | |
return 0; | |
} | |
+#ifdef __OpenBSD__ | |
+#include <sys/ioctl.h> | |
+#include <fcntl.h> | |
+#include <machine/apmvar.h> | |
+ | |
int | |
battread(char *buf, size_t len) | |
{ | |
t@@ -71,6 +72,13 @@ battread(char *buf, size_t len) | |
snprintf(buf, len, "%d", info.battery_life); | |
return 0; | |
} | |
+#else | |
+int | |
+battread(char *buf, size_t len) | |
+{ | |
+ return dummyread(buf, len); | |
+} | |
+#endif | |
int | |
dateread(char *buf, size_t len) |