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
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]