Package: procinfo
Version: 18-1

I'm guessing this has something to do with "long"'s being 64-bit on 64-bit
machines. But I'm not sure if it's the long's that procinfo is generating
from the parsed /proc text, or the time_t type created by gettimeofday.
Either way, changing float's to double's for calculating the elapsed time
fixes the problem for me.

diff -ru procinfo-18/procinfo.c procinfo-18-mine/procinfo.c
--- procinfo-18/procinfo.c      2006-07-24 22:15:21.000000000 +1000
+++ procinfo-18-mine/procinfo.c 2006-07-24 22:15:25.000000000 +1000
@@ -78,7 +78,7 @@
 
 char line[1024], cmdline[1024], booted[40], *version = NULL, *message =
NULL; 
-float rate = 1.0;              /* per interval or per sec */
+double rate = 1.0;             /* per interval or per sec */
 
 struct info new, old, base;
 struct utsname ut;
@@ -1060,8 +1060,8 @@
            then = now;
            gettimeofday (&now, 0);
            if (per_sec)
-               rate = (float) now.tv_sec + (float) now.tv_usec / 1.0e6 -
-                   (float) then.tv_sec - (float) then.tv_usec / 1.0e6;
+               rate = (double) now.tv_sec + (double) now.tv_usec / 1.0e6 -
+                   (double) then.tv_sec - (double) then.tv_usec / 1.0e6;
 
        } else {
            putchar ('\n');

Attachment: signature.asc
Description: PGP signature

Reply via email to