openbsd-ports/x11/icewm/patches/apm-patch-src_aapm_cc
2010-12-12 19:13:01 +00:00

31 lines
987 B
Plaintext

$OpenBSD: apm-patch-src_aapm_cc,v 1.3 2010/12/12 19:13:01 jasper Exp $
--- src/aapm.cc.orig Sun Oct 31 15:09:36 2010
+++ src/aapm.cc Thu Dec 9 16:07:57 2010
@@ -38,7 +38,7 @@
#include <dev/acpica/acpiio.h>
#endif
-#ifdef __NetBSD__
+#if defined __NetBSD__ || defined __OpenBSD__
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/types.h>
@@ -73,7 +73,7 @@ static YColor *taskBarBg = 0;
void YApm::ApmStr(char *s, bool Tool) {
#if defined(__FreeBSD__) && defined(i386)
struct apm_info ai;
-#elif defined __NetBSD__
+#elif defined __NetBSD__ || defined __OpenBSD__
struct apm_power_info ai;
#else
char buf[80];
@@ -114,7 +114,7 @@ void YApm::ApmStr(char *s, bool Tool) {
BATlife = ai.ai_batt_life;
BATtime = ai.ai_batt_time == 0 ? -1 : ai.ai_batt_time;
strcpy(units, "sec");
-#elif defined __NetBSD__
+#elif defined __NetBSD__ || defined __OpenBSD__
memset(&ai, 0, sizeof(ai));
if (ioctl(fd, APM_IOC_GETPOWER, &ai) == -1)
{