diff options
Diffstat (limited to 'procps')
-rw-r--r-- | procps/ps.c | 2 | ||||
-rw-r--r-- | procps/top.c | 8 | ||||
-rw-r--r-- | procps/watch.c | 3 |
3 files changed, 7 insertions, 6 deletions
diff --git a/procps/ps.c b/procps/ps.c index b82c126d2..c3b200866 100644 --- a/procps/ps.c +++ b/procps/ps.c | |||
@@ -142,7 +142,7 @@ static unsigned get_kernel_HZ(void) | |||
142 | if (kernel_HZ == (unsigned)-1) | 142 | if (kernel_HZ == (unsigned)-1) |
143 | kernel_HZ = get_HZ_by_waiting(); | 143 | kernel_HZ = get_HZ_by_waiting(); |
144 | 144 | ||
145 | //if (open_read_close("/proc/uptime", buf, sizeof(buf) <= 0) | 145 | //if (open_read_close("/proc/uptime", buf, sizeof(buf)) <= 0) |
146 | // bb_perror_msg_and_die("can't read %s", "/proc/uptime"); | 146 | // bb_perror_msg_and_die("can't read %s", "/proc/uptime"); |
147 | //buf[sizeof(buf)-1] = '\0'; | 147 | //buf[sizeof(buf)-1] = '\0'; |
148 | ///sscanf(buf, "%llu", &seconds_since_boot); | 148 | ///sscanf(buf, "%llu", &seconds_since_boot); |
diff --git a/procps/top.c b/procps/top.c index f5c0a123f..e4afafc4c 100644 --- a/procps/top.c +++ b/procps/top.c | |||
@@ -478,8 +478,8 @@ static unsigned long display_header(int scr_width, int *lines_rem_p) | |||
478 | snprintf(scrbuf, scr_width, | 478 | snprintf(scrbuf, scr_width, |
479 | "Mem: %luK used, %luK free, %luK shrd, %luK buff, %luK cached", | 479 | "Mem: %luK used, %luK free, %luK shrd, %luK buff, %luK cached", |
480 | used, mfree, shared, buffers, cached); | 480 | used, mfree, shared, buffers, cached); |
481 | /* clear screen & go to top */ | 481 | /* go to top & clear to the end of screen */ |
482 | printf(OPT_BATCH_MODE ? "%s\n" : "\e[H\e[J%s\n", scrbuf); | 482 | printf(OPT_BATCH_MODE ? "%s\n" : "\033[H\033[J%s\n", scrbuf); |
483 | (*lines_rem_p)--; | 483 | (*lines_rem_p)--; |
484 | 484 | ||
485 | /* Display CPU time split as percentage of total time | 485 | /* Display CPU time split as percentage of total time |
@@ -518,7 +518,7 @@ static NOINLINE void display_process_list(int lines_rem, int scr_width) | |||
518 | #endif | 518 | #endif |
519 | 519 | ||
520 | /* what info of the processes is shown */ | 520 | /* what info of the processes is shown */ |
521 | printf(OPT_BATCH_MODE ? "%.*s" : "\e[7m%.*s\e[0m", scr_width, | 521 | printf(OPT_BATCH_MODE ? "%.*s" : "\033[7m%.*s\033[0m", scr_width, |
522 | " PID PPID USER STAT VSZ %MEM" | 522 | " PID PPID USER STAT VSZ %MEM" |
523 | IF_FEATURE_TOP_SMP_PROCESS(" CPU") | 523 | IF_FEATURE_TOP_SMP_PROCESS(" CPU") |
524 | IF_FEATURE_TOP_CPU_USAGE_PERCENTAGE(" %CPU") | 524 | IF_FEATURE_TOP_CPU_USAGE_PERCENTAGE(" %CPU") |
@@ -772,7 +772,7 @@ static void display_topmem_header(int scr_width, int *lines_rem_p) | |||
772 | snprintf(linebuf, sizeof(linebuf), | 772 | snprintf(linebuf, sizeof(linebuf), |
773 | "Mem total:%s anon:%s map:%s free:%s", | 773 | "Mem total:%s anon:%s map:%s free:%s", |
774 | S(total), S(anon), S(map), S(mfree)); | 774 | S(total), S(anon), S(map), S(mfree)); |
775 | printf(OPT_BATCH_MODE ? "%.*s\n" : "\e[H\e[J%.*s\n", scr_width, linebuf); | 775 | printf(OPT_BATCH_MODE ? "%.*s\n" : "\033[H\033[J%.*s\n", scr_width, linebuf); |
776 | 776 | ||
777 | snprintf(linebuf, sizeof(linebuf), | 777 | snprintf(linebuf, sizeof(linebuf), |
778 | " slab:%s buf:%s cache:%s dirty:%s write:%s", | 778 | " slab:%s buf:%s cache:%s dirty:%s write:%s", |
diff --git a/procps/watch.c b/procps/watch.c index 126945c40..a1cde9ea0 100644 --- a/procps/watch.c +++ b/procps/watch.c | |||
@@ -52,7 +52,8 @@ int watch_main(int argc UNUSED_PARAM, char **argv) | |||
52 | width = (unsigned)-1; // make sure first time new_width != width | 52 | width = (unsigned)-1; // make sure first time new_width != width |
53 | header = NULL; | 53 | header = NULL; |
54 | while (1) { | 54 | while (1) { |
55 | printf("\033[H\033[J"); | 55 | /* home; clear to the end of screen */ |
56 | printf("\033[H""\033[J"); | ||
56 | if (!(opt & 0x2)) { // no -t | 57 | if (!(opt & 0x2)) { // no -t |
57 | const unsigned time_len = sizeof("1234-67-90 23:56:89"); | 58 | const unsigned time_len = sizeof("1234-67-90 23:56:89"); |
58 | time_t t; | 59 | time_t t; |