[Pkg-xfce-devel] Bug#664208: Info received (xfce4-cpugraph-plugin: System load graph shows 100% load on unloaded cores, but cores are actually idle)
Stefan Erben
stefan at erben.com
Fri Mar 16 21:13:24 UTC 2012
If you change the gulong to calc into guint64 and the sscanf() accordingly, it works again:
--- os.c.orig 2010-11-07 13:58:22.000000000 +0100
+++ os.c 2012-03-16 21:59:03.941257947 +0100
@@ -94,7 +94,7 @@ gboolean read_cpu_data( CpuData *data, g
{
FILE *fStat;
gchar cpuStr[PROCMAXLNLEN];
- gulong user, nice, system, idle, used, total, iowait, irq, softirq;
+ guint64 user, nice, system, idle, used, total, iowait, irq, softirq;
guint line;
if( !(fStat = fopen( PROC_STAT, "r" )) )
@@ -109,7 +109,7 @@ gboolean read_cpu_data( CpuData *data, g
fclose( fStat );
return FALSE;
}
- if( sscanf( cpuStr, "%*s %lu %lu %lu %lu %lu %lu %lu", &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;
cu, Stefan
More information about the Pkg-xfce-devel
mailing list