summaryrefslogtreecommitdiff
path: root/x11/kdebase3/patches/patch-fh
diff options
context:
space:
mode:
Diffstat (limited to 'x11/kdebase3/patches/patch-fh')
-rw-r--r--x11/kdebase3/patches/patch-fh37
1 files changed, 23 insertions, 14 deletions
diff --git a/x11/kdebase3/patches/patch-fh b/x11/kdebase3/patches/patch-fh
index e97d0228d72..4d55824cb6b 100644
--- a/x11/kdebase3/patches/patch-fh
+++ b/x11/kdebase3/patches/patch-fh
@@ -1,8 +1,8 @@
-$NetBSD: patch-fh,v 1.5 2006/10/08 07:49:27 markd Exp $
+$NetBSD: patch-fh,v 1.6 2008/01/04 21:05:58 markd Exp $
--- ksysguard/ksysguardd/NetBSD/CPU.c.orig 2005-10-11 04:04:31.000000000 +1300
+++ ksysguard/ksysguardd/NetBSD/CPU.c
-@@ -19,6 +19,8 @@
+@@ -19,10 +19,11 @@
*/
@@ -11,20 +11,24 @@ $NetBSD: patch-fh,v 1.5 2006/10/08 07:49:27 markd Exp $
#include <sys/dkstat.h>
#include <sys/sched.h> /* CPUSTATES */
#include <fcntl.h>
-@@ -33,20 +35,13 @@
+-#include <kvm.h>
+ #include <nlist.h>
+ #include <stdio.h>
+ #include <stdlib.h>
+@@ -33,20 +34,11 @@
#include "Command.h"
#include "ksysguardd.h"
-long percentages(int cnt, int *out, long *new, long *old, long *diffs);
--
++void percentages(int, int *, u_int64_t *, u_int64_t *, u_int64_t *);
+
-struct nlist my_nlist[] = {
- {"_cp_time"},
- { 0 }
-};
-+void percentages(int, int *, u_int64_t *, u_int64_t *, u_int64_t *);
-
- kvm_t *kd;
-
+-
+-kvm_t *kd;
+-
-unsigned long cp_time_offset;
-
-long cp_time[CPUSTATES];
@@ -36,18 +40,23 @@ $NetBSD: patch-fh,v 1.5 2006/10/08 07:49:27 markd Exp $
int cpu_states[CPUSTATES];
void
-@@ -61,9 +56,7 @@ initCpuInfo(struct SensorModul* sm)
+@@ -61,9 +53,6 @@ initCpuInfo(struct SensorModul* sm)
printCPUSysInfo, sm);
registerMonitor("cpu/idle", "integer", printCPUIdle,
printCPUIdleInfo, sm);
- kd = kvm_open(NULL, NULL, NULL, O_RDONLY, "kvm_open");
- kvm_nlist(kd, my_nlist);
- cp_time_offset = my_nlist[0].n_value;
-+ kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, "kvm_open");
updateCpuInfo();
}
-@@ -77,7 +70,13 @@ exitCpuInfo(void)
+@@ -71,13 +60,18 @@ initCpuInfo(struct SensorModul* sm)
+ void
+ exitCpuInfo(void)
+ {
+- kvm_close(kd);
+ }
+
int
updateCpuInfo(void)
{
@@ -62,7 +71,7 @@ $NetBSD: patch-fh,v 1.5 2006/10/08 07:49:27 markd Exp $
percentages(CPUSTATES, cpu_states, cp_time, cp_old, cp_diff);
return (0);
}
-@@ -152,20 +151,20 @@ printCPUIdleInfo(const char* cmd)
+@@ -152,20 +146,20 @@ printCPUIdleInfo(const char* cmd)
* useful on BSD mchines for calculating cpu state percentages.
*/
@@ -92,7 +101,7 @@ $NetBSD: patch-fh,v 1.5 2006/10/08 07:49:27 markd Exp $
/* initialization */
total_change = 0;
-@@ -174,12 +173,11 @@ long *diffs;
+@@ -174,12 +168,11 @@ long *diffs;
/* calculate changes for each state and the overall change */
for (i = 0; i < cnt; i++)
{
@@ -110,7 +119,7 @@ $NetBSD: patch-fh,v 1.5 2006/10/08 07:49:27 markd Exp $
total_change += (*dp++ = change);
*old++ = *new++;
}
-@@ -191,16 +189,9 @@ long *diffs;
+@@ -191,16 +184,9 @@ long *diffs;
}
/* calculate percentages based on overall change, rounding up */