aboutsummaryrefslogtreecommitdiff
path: root/procps
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2009-11-07 04:06:31 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2009-11-07 04:06:31 +0100
commit9be4f31da0c5133bf012c1d404cdaf6823c72938 (patch)
tree54b46bcc97f7510d94c85c0ad1281ce4ae40585c /procps
parent6e8e666bd9d62772713af7f06ce9495d21d51f4e (diff)
downloadbusybox-w32-9be4f31da0c5133bf012c1d404cdaf6823c72938.tar.gz
busybox-w32-9be4f31da0c5133bf012c1d404cdaf6823c72938.tar.bz2
busybox-w32-9be4f31da0c5133bf012c1d404cdaf6823c72938.zip
top: do not use #if inside printf, it can be a macro
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'procps')
-rw-r--r--procps/top.c24
1 files changed, 6 insertions, 18 deletions
diff --git a/procps/top.c b/procps/top.c
index 79915697c..f514df78a 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -522,12 +522,8 @@ static NOINLINE void display_process_list(int lines_rem, int scr_width)
522 /* what info of the processes is shown */ 522 /* what info of the processes is shown */
523 printf(OPT_BATCH_MODE ? "%.*s" : "\e[7m%.*s\e[0m", scr_width, 523 printf(OPT_BATCH_MODE ? "%.*s" : "\e[7m%.*s\e[0m", scr_width,
524 " PID PPID USER STAT VSZ %MEM" 524 " PID PPID USER STAT VSZ %MEM"
525#if ENABLE_FEATURE_TOP_SMP_PROCESS 525 IF_FEATURE_TOP_SMP_PROCESS(" CPU")
526 " CPU" 526 IF_FEATURE_TOP_CPU_USAGE_PERCENTAGE(" %CPU")
527#endif
528#if ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE
529 " %CPU"
530#endif
531 " COMMAND"); 527 " COMMAND");
532 lines_rem--; 528 lines_rem--;
533 529
@@ -606,22 +602,14 @@ static NOINLINE void display_process_list(int lines_rem, int scr_width)
606 /* PID PPID USER STAT VSZ %MEM [%CPU] COMMAND */ 602 /* PID PPID USER STAT VSZ %MEM [%CPU] COMMAND */
607 col = snprintf(line_buf, scr_width, 603 col = snprintf(line_buf, scr_width,
608 "\n" "%5u%6u %-8.8s %s%s" FMT 604 "\n" "%5u%6u %-8.8s %s%s" FMT
609#if ENABLE_FEATURE_TOP_SMP_PROCESS 605 IF_FEATURE_TOP_SMP_PROCESS(" %3d")
610 " %3d" 606 IF_FEATURE_TOP_CPU_USAGE_PERCENTAGE(FMT)
611#endif
612#if ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE
613 FMT
614#endif
615 " ", 607 " ",
616 s->pid, s->ppid, get_cached_username(s->uid), 608 s->pid, s->ppid, get_cached_username(s->uid),
617 s->state, vsz_str_buf, 609 s->state, vsz_str_buf,
618 SHOW_STAT(pmem) 610 SHOW_STAT(pmem)
619#if ENABLE_FEATURE_TOP_SMP_PROCESS 611 IF_FEATURE_TOP_SMP_PROCESS(, s->last_seen_on_cpu)
620 , s->last_seen_on_cpu 612 IF_FEATURE_TOP_CPU_USAGE_PERCENTAGE(, SHOW_STAT(pcpu))
621#endif
622#if ENABLE_FEATURE_TOP_CPU_USAGE_PERCENTAGE
623 , SHOW_STAT(pcpu)
624#endif
625 ); 613 );
626 if ((int)(col + 1) < scr_width) 614 if ((int)(col + 1) < scr_width)
627 read_cmdline(line_buf + col, scr_width - col, s->pid, s->comm); 615 read_cmdline(line_buf + col, scr_width - col, s->pid, s->comm);