SCCS-vsn: usr.bin/systat/pigs.c 5.3
-static char sccsid[] = "@(#)pigs.c 5.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)pigs.c 5.3 (Berkeley) %G%";
- pt[numprocs].pt_pctcpu = total / (1.0 - idle) * idle;
- total += pt[numprocs].pt_pctcpu;
+ pt[numprocs].pt_pctcpu = idle;
+ total += idle;
pt[numprocs].pt_uid = -1;
pt[numprocs].pt_pid = -1;
pt[numprocs].pt_pp = NULL;
pt[numprocs].pt_uid = -1;
pt[numprocs].pt_pid = -1;
pt[numprocs].pt_pp = NULL;
+ if (total < 1.0)
+ total = 1.0;
factor = 50.0/total;
/* Find the top few by executing a "bubble pass" ten times. */
factor = 50.0/total;
/* Find the top few by executing a "bubble pass" ten times. */