aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author"Vladimir N. Oleynik" <dzo@simtreas.ru>2006-02-15 17:15:56 +0000
committer"Vladimir N. Oleynik" <dzo@simtreas.ru>2006-02-15 17:15:56 +0000
commitc218a293253a43e5df73e39cfcfbfd8258ed1380 (patch)
treef6c45a7d942bd83e8d8c802f3b377ae314a731c4
parent9a51540b1584d480f710ac8cff1218e77c6cdd62 (diff)
downloadbusybox-w32-c218a293253a43e5df73e39cfcfbfd8258ed1380.tar.gz
busybox-w32-c218a293253a43e5df73e39cfcfbfd8258ed1380.tar.bz2
busybox-w32-c218a293253a43e5df73e39cfcfbfd8258ed1380.zip
add last terminal line
-rw-r--r--procps/top.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/procps/top.c b/procps/top.c
index f2e798bde..afd419ba5 100644
--- a/procps/top.c
+++ b/procps/top.c
@@ -394,9 +394,13 @@ static void display_status(int count, int col)
394 s->pid, s->user, s->state, rss_str_buf, s->ppid, 394 s->pid, s->user, s->state, rss_str_buf, s->ppid,
395 pmem/10, pmem%10); 395 pmem/10, pmem%10);
396#endif 396#endif
397 if((int)strlen(namecmd) > col) 397 if((int)strlen(namecmd) > col)
398 namecmd[col] = 0; 398 namecmd[col] = 0;
399 printf("%s\n", namecmd); 399 printf("%s", namecmd);
400 if(count)
401 putchar('\n');
402 else
403 fflush(stdout);
400 s++; 404 s++;
401 } 405 }
402} 406}
@@ -485,7 +489,7 @@ int top_main(int argc, char **argv)
485 489
486 get_terminal_width_height(0, &col, &lines); 490 get_terminal_width_height(0, &col, &lines);
487 if (lines > 4) { 491 if (lines > 4) {
488 lines -= 5; 492 lines -= 4;
489#ifdef CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE 493#ifdef CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE
490 col = col - 80 + 35 - 6; 494 col = col - 80 + 35 - 6;
491#else 495#else
@@ -544,7 +548,7 @@ int top_main(int argc, char **argv)
544 return EXIT_FAILURE; 548 return EXIT_FAILURE;
545 } 549 }
546 if(c == 'q' || c == initial_settings.c_cc[VINTR]) 550 if(c == 'q' || c == initial_settings.c_cc[VINTR])
547 return EXIT_SUCCESS; 551 break;
548 if(c == 'M') { 552 if(c == 'M') {
549#ifdef CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE 553#ifdef CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE
550 sort_function[0] = mem_sort; 554 sort_function[0] = mem_sort;
@@ -579,6 +583,8 @@ int top_main(int argc, char **argv)
579#endif /* CONFIG_FEATURE_USE_TERMIOS */ 583#endif /* CONFIG_FEATURE_USE_TERMIOS */
580 clearmems(); 584 clearmems();
581 } 585 }
582 586 if(ENABLE_FEATURE_CLEAN_UP)
587 clearmems();
588 putchar('\n');
583 return EXIT_SUCCESS; 589 return EXIT_SUCCESS;
584} 590}