aboutsummaryrefslogtreecommitdiff
path: root/procps/top.c
diff options
context:
space:
mode:
authorvda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-12-30 17:57:03 +0000
committervda <vda@69ca8d6d-28ef-0310-b511-8ec308f3f277>2006-12-30 17:57:03 +0000
commit278c4c60c21f7dcab75ab1137e15079d5cf3c324 (patch)
tree948ce196f871abcf9410ca1521a3d2a5af6a3082 /procps/top.c
parenta88ee74e24aba1481887ac6d68215c78f517b60e (diff)
downloadbusybox-w32-278c4c60c21f7dcab75ab1137e15079d5cf3c324.tar.gz
busybox-w32-278c4c60c21f7dcab75ab1137e15079d5cf3c324.tar.bz2
busybox-w32-278c4c60c21f7dcab75ab1137e15079d5cf3c324.zip
done a dozen of randconfig test. guess what? ALL failed...
these are resulting fixes git-svn-id: svn://busybox.net/trunk/busybox@17105 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'procps/top.c')
-rw-r--r--procps/top.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/procps/top.c b/procps/top.c
index 8d732d4b2..d1fbfe6e1 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -50,12 +50,13 @@ struct save_hist {
50 unsigned long ticks; 50 unsigned long ticks;
51 unsigned pid; 51 unsigned pid;
52}; 52};
53#if ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE
53static struct save_hist *prev_hist; 54static struct save_hist *prev_hist;
54static int prev_hist_count; 55static int prev_hist_count;
55/* static int hist_iterations; */ 56/* static int hist_iterations; */
56static unsigned total_pcpu; 57static unsigned total_pcpu;
57/* static unsigned long total_rss; */ 58/* static unsigned long total_rss; */
58 59#endif
59 60
60#define OPT_BATCH_MODE (option_mask32 & 0x4) 61#define OPT_BATCH_MODE (option_mask32 & 0x4)
61 62
@@ -485,7 +486,9 @@ int top_main(int argc, char **argv)
485 top[n].pid = p->pid; 486 top[n].pid = p->pid;
486 top[n].ppid = p->ppid; 487 top[n].ppid = p->ppid;
487 top[n].rss = p->rss; 488 top[n].rss = p->rss;
489#if ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE
488 top[n].ticks = p->stime + p->utime; 490 top[n].ticks = p->stime + p->utime;
491#endif
489 top[n].uid = p->uid; 492 top[n].uid = p->uid;
490 strcpy(top[n].state, p->state); 493 strcpy(top[n].state, p->state);
491 strcpy(top[n].comm, p->comm); 494 strcpy(top[n].comm, p->comm);