[Xfce4-commits] <xfce4-battery-plugin:master> Compile fix for OpenBSD

Florian Rivoal noreply at xfce.org
Tue Dec 28 12:20:01 CET 2010


Updating branch refs/heads/master
         to 978739783bdca4fe6bfdff14ae3ed06ebd61987b (commit)
       from d2b75742d13ac97ee964ba59d37840810d4f5aeb (commit)

commit 978739783bdca4fe6bfdff14ae3ed06ebd61987b
Author: Florian Rivoal <frivoal at xfce.org>
Date:   Tue Dec 28 20:19:40 2010 +0900

    Compile fix for OpenBSD

 panel-plugin/battery.c |    5 +++--
 panel-plugin/libacpi.c |    2 +-
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/panel-plugin/battery.c b/panel-plugin/battery.c
index b96bfe7..ad8dba1 100644
--- a/panel-plugin/battery.c
+++ b/panel-plugin/battery.c
@@ -29,6 +29,7 @@
 #elif __OpenBSD__
 #include <sys/param.h>
 #include <machine/apmvar.h>
+#define APMDEVICE "/dev/apm"
 #elif __NetBSD__
 #include <sys/param.h>
 #include <sys/ioctl.h>
@@ -210,7 +211,7 @@ detect_battery_info(t_battmon *battmon)
       battmon->method = BM_BROKEN;
       fd = open(APMDEVICE, O_RDONLY);
       if (fd == -1) return FALSE;
-      +      if (ioctl(fd, APM_IOC_GETPOWER, &apm) == -1) {
+            if (ioctl(fd, APM_IOC_GETPOWER, &apm) == -1) {
         close(fd);
              return FALSE;
     }
@@ -303,7 +304,7 @@ update_apm_status(t_battmon *battmon)
       battmon->method = BM_BROKEN;
       fd = open(APMDEVICE, O_RDONLY);
       if (fd == -1) return TRUE;
-      if (ioctl(fd, APM_IOC_GETPOWER, &apminfo) == -1)
+      if (ioctl(fd, APM_IOC_GETPOWER, &apm) == -1)
             return TRUE;
       close(fd);
       charge = apm.battery_life;
diff --git a/panel-plugin/libacpi.c b/panel-plugin/libacpi.c
index 15050f2..87339b7 100644
--- a/panel-plugin/libacpi.c
+++ b/panel-plugin/libacpi.c
@@ -32,7 +32,7 @@
 
 #if HAVE_SYSCTL
 
-#ifdef __NetBSD__
+#if defined(__NetBSD__) || defined (__OpenBSD__)
 #include <sys/param.h>
 /* CTLTYPE does not exist in NetBSD headers.
  * Defining it to 0x0f here won't do any harm though. */



More information about the Xfce4-commits mailing list