[Xfce4-commits] <xfce4-cpugraph-plugin:master> Fix 64bit linux support

Florian Rivoal noreply at xfce.org
Sat May 29 10:54:01 CEST 2010


Updating branch refs/heads/master
         to 16367c76f05cb59dd869c1f3cc0a0d111400c92c (commit)
       from 2a7565903fed17213576222d3968fe82573ef5cb (commit)

commit 16367c76f05cb59dd869c1f3cc0a0d111400c92c
Author: Florian Rivoal <frivoal at gmail.com>
Date:   Sat May 29 17:40:05 2010 +0900

    Fix 64bit linux support
    
    Scannf was trying to store longs in ints, which works on 32
    bit systems, but not on 64 bit ones. Should be better now.

 panel-plugin/os.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/panel-plugin/os.c b/panel-plugin/os.c
index 4a843e1..3abadac 100644
--- a/panel-plugin/os.c
+++ b/panel-plugin/os.c
@@ -65,7 +65,7 @@ gboolean read_cpu_data( CpuData *data, guint nb_cpu)
 {
 	FILE *fStat;
 	gchar cpuStr[PROCMAXLNLEN];
-	guint user, nice, system, idle, used, total, iowait, irq, softirq;
+	gulong user, nice, system, idle, used, total, iowait, irq, softirq;
 	guint line;
 
 	if( !(fStat = fopen( PROC_STAT, "r" )) )
@@ -80,7 +80,7 @@ gboolean read_cpu_data( CpuData *data, guint nb_cpu)
 			fclose( fStat );
 			return FALSE;
 		}
-		if( sscanf( cpuStr, "%*s %ld %ld %ld %ld %ld %ld %ld", &user, &nice, &system, &idle, &iowait, &irq, &softirq ) < 7 )
+		if( sscanf( cpuStr, "%*s %lu %lu %lu %lu %lu %lu %lu", &user, &nice, &system, &idle, &iowait, &irq, &softirq ) < 7 )
 			iowait = irq = softirq = 0;
 		used = user + nice + system + irq + softirq;
 		total = used + idle + iowait;



More information about the Xfce4-commits mailing list