[Initng-svn] r2324 - in initng: . plugins/idleprobe

svn at initng.thinktux.net svn at initng.thinktux.net
Sun Dec 4 21:55:42 CET 2005


Author: jimmy
Date: Sun Dec  4 21:55:41 2005
New Revision: 2324

Modified:
   initng/configure.in
   initng/plugins/idleprobe/initng_idleprobe.c
Log:
Fix from bug 318


Modified: initng/configure.in
==============================================================================
--- initng/configure.in	(original)
+++ initng/configure.in	Sun Dec  4 21:55:41 2005
@@ -28,14 +28,20 @@
 -Wformat-nonliteral \
 -Wformat-security \
 -Wsequence-point \
--Wunused-function \
--Wunused-label \
--Wunused-variable \
--Wunused-value \
 -Wuninitialized \
 -Wundef \
+-Wunused \
+-Wcomment \
 -Werror"
 
+
+# All set by -Wunused
+#-Wunused-function \
+#-Wunused-label \
+#-Wunused-variable \
+#-Wunused-value \
+#-Wunused-parameter \
+
 # Bad code not, working.
 #if test "${CFLAGS+set}" != "set"; then
 #    use_initng_CFLAGS=yes

Modified: initng/plugins/idleprobe/initng_idleprobe.c
==============================================================================
--- initng/plugins/idleprobe/initng_idleprobe.c	(original)
+++ initng/plugins/idleprobe/initng_idleprobe.c	Sun Dec  4 21:55:41 2005
@@ -46,10 +46,6 @@
 #include <errno.h>
 #include <time.h>
 
-// we'll trim to zero if we get negative time ticks,
-// which has happened with some SMP kernels (pre-2.4?)
-#define TRIMz(x)  ((tz = (unsigned long long)(x)) < 0 ? 0 : tz)
-
 
 typedef unsigned long long ull_t;
 typedef unsigned long long ll_t;
@@ -86,8 +82,7 @@
     static ull_t cpu_user, cpu_nice, cpu_system, cpu_idle;
     static ull_t cpu_dummy1, cpu_dummy2, cpu_dummy3;
     static ll_t cpu_user_frm, cpu_nice_frm, cpu_system_frm, cpu_idle_frm;
-    static ll_t cpu_dummy1_frm, cpu_dummy2_frm, cpu_dummy3_frm, cpu_tot_frm,
-        tz;
+    static ll_t cpu_dummy1_frm, cpu_dummy2_frm, cpu_dummy3_frm, cpu_tot_frm;
 
     static char buf[256 + 64];
     static int idle_cnt = 0;
@@ -153,7 +148,7 @@
     cpu_user_frm = cpu_user - old_cpu_user;
     cpu_nice_frm = cpu_nice - old_cpu_nice;
     cpu_system_frm = cpu_system - old_cpu_system;
-    cpu_idle_frm = TRIMz(cpu_idle - old_cpu_idle);
+    cpu_idle_frm = cpu_idle > old_cpu_idle ? cpu_idle - old_cpu_idle : 0;
     cpu_dummy1_frm = cpu_dummy1 - old_cpu_dummy1;
     cpu_dummy2_frm = cpu_dummy2 - old_cpu_dummy2;
     cpu_dummy3_frm = cpu_dummy3 - old_cpu_dummy3;


More information about the Initng-svn mailing list