summaryrefslogtreecommitdiff
path: root/x11/kdebase3/patches/patch-de
blob: 6051d22d3f8bd58c34b985f4363fe453a1a31b44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
$NetBSD: patch-de,v 1.2 2002/08/25 19:23:45 jlam Exp $

--- ksysguard/ksysguardd/FreeBSD/apm.c.orig	Tue Sep 18 15:03:53 2001
+++ ksysguard/ksysguardd/FreeBSD/apm.c
@@ -20,7 +20,13 @@
 */
 
 #include <fcntl.h>
+#if defined(__NetBSD__)
+#include <machine/apmvar.h>
+#include <sys/ioctl.h>
+#include <unistd.h>
+#else
 #include <machine/apm_bios.h>
+#endif
 #include <stdio.h>
 
 #include "Command.h"
@@ -62,13 +68,22 @@
 int
 updateApm(void)
 {
-	struct apm_info info;
 	int retval;
+#if defined(__NetBSD__)
+	struct apm_power_info info;
+
+	retval = ioctl(ApmFD, APM_IOC_GETPOWER, &info);
+
+	BattFill = info.battery_life;
+	BattTime = info.minutes_left;
+#else
+	struct apm_info info;
 
 	retval = ioctl(ApmFD, APMIO_GETINFO, &info);
 
 	BattFill = info.ai_batt_life;
 	BattTime = info.ai_batt_time;
+#endif
 
 	return retval;
 }