[Pkg-wmaker-commits] [wmbubble] 153/207: restore non-debian files to orig state

Doug Torrance dtorrance-guest at moszumanska.debian.org
Mon Aug 24 04:18:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

dtorrance-guest pushed a commit to branch master
in repository wmbubble.

commit b95599dc51df799917d501b81e7134e02e8d910b
Author: Doug Torrance <dtorrance at monmouthcollege.edu>
Date:   Sat Jun 21 00:58:33 2014 -0600

    restore non-debian files to orig state
---
 Makefile      |  7 -------
 bubblemon.c   |  2 +-
 sys_freebsd.c | 23 +++++++----------------
 3 files changed, 8 insertions(+), 24 deletions(-)

diff --git a/Makefile b/Makefile
index 896a28f..8148514 100644
--- a/Makefile
+++ b/Makefile
@@ -28,13 +28,6 @@ ifeq ($(OS), FreeBSD)
 	INSTALL = -c -g kmem -m 2755 -o root
 endif
 
-ifeq ($(OS), GNU/kFreeBSD)
-	OBJS += sys_freebsd.o
-	LIBS = -lX11 -lkvm -lm
-	INSTALL = -c -g kmem -m 2755 -o root
-	CFLAGS += -D_BSD_SOURCE
-endif
-
 # special things for NetBSD
 ifeq ($(OS), NetBSD)
 	OBJS += sys_netbsd.o
diff --git a/bubblemon.c b/bubblemon.c
index ac0a516..1e51cae 100644
--- a/bubblemon.c
+++ b/bubblemon.c
@@ -404,7 +404,7 @@ int main(int argc, char **argv) {
 
 	argv++; argc--; /* Otherwise we'll make more of ourselves on a left click */
 
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
+#ifdef __FreeBSD__
 	if (init_stuff())
 		exit(-1);
 #endif
diff --git a/sys_freebsd.c b/sys_freebsd.c
index 1cf68f7..a5098a8 100644
--- a/sys_freebsd.c
+++ b/sys_freebsd.c
@@ -37,6 +37,7 @@ extern BubbleMonData bm;
 
 static kvm_t *kd = NULL;
 static struct nlist nlst[] = {
+    {"_cp_time", 0},
     {"_cnt", 0},
     {"_bufspace", 0},
     {0, 0}
@@ -66,7 +67,7 @@ int init_stuff()
 
     kvm_nlist(kd, nlst);
 
-    if (nlst[0].n_type == 0 || nlst[1].n_type == 0) {
+    if (nlst[0].n_type == 0 || nlst[1].n_type == 0 || nlst[2].n_type == 0) {
 	puts("Error extracting symbols");
 	return 2;
     }
@@ -92,19 +93,9 @@ int system_cpu(void)
     unsigned long int cpu_time[CPUSTATES];
     int i;
 
-    static int mib[2];
-    size_t len = 2;
-
-    size_t size;
-
-    if (sysctlnametomib("kern.cp_time", mib, &len) < 0)
-        return 0;
-
-    size = sizeof (cpu_time);
-
-
-    if (sysctl(mib, 2, &cpu_time, &size, NULL, 0) < 0)
-        return 0;
+    if (kvm_read(kd, nlst[0].n_value, &cpu_time, sizeof(cpu_time))
+	!= sizeof(cpu_time))
+	return 0;
 
     load = cpu_time[CP_USER] + cpu_time[CP_SYS] + cpu_time[CP_NICE];
     total = load + cpu_time[CP_IDLE];
@@ -142,10 +133,10 @@ void system_memory(void)
     static time_t last_time_swap = 0;
     time_t curr_time;
 	
-    if (kvm_read(kd, nlst[0].n_value, &sum, sizeof(sum)) != sizeof(sum))
+    if (kvm_read(kd, nlst[1].n_value, &sum, sizeof(sum)) != sizeof(sum))
 	return;		/* _cnt */
 
-    if (kvm_read(kd, nlst[1].n_value, &bufspace, sizeof(bufspace)) !=
+    if (kvm_read(kd, nlst[2].n_value, &bufspace, sizeof(bufspace)) !=
 	sizeof(bufspace))
 	return;		/* _bufspace */
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-wmaker/wmbubble.git



More information about the Pkg-wmaker-commits mailing list