diff options
Diffstat (limited to 'procps/watch.c')
-rw-r--r-- | procps/watch.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/procps/watch.c b/procps/watch.c index 6fc9f7db7..420e6d3d1 100644 --- a/procps/watch.c +++ b/procps/watch.c | |||
@@ -7,10 +7,6 @@ | |||
7 | * | 7 | * |
8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. | 8 | * Licensed under GPLv2 or later, see file LICENSE in this source tree. |
9 | */ | 9 | */ |
10 | |||
11 | /* BB_AUDIT SUSv3 N/A */ | ||
12 | /* BB_AUDIT GNU defects -- only option -n is supported. */ | ||
13 | |||
14 | //config:config WATCH | 10 | //config:config WATCH |
15 | //config: bool "watch (4.1 kb)" | 11 | //config: bool "watch (4.1 kb)" |
16 | //config: default y | 12 | //config: default y |
@@ -35,8 +31,13 @@ | |||
35 | //usage: "Mon Dec 17 10:31:42 GMT 2000\n" | 31 | //usage: "Mon Dec 17 10:31:42 GMT 2000\n" |
36 | //usage: "Mon Dec 17 10:31:44 GMT 2000" | 32 | //usage: "Mon Dec 17 10:31:44 GMT 2000" |
37 | 33 | ||
34 | /* BB_AUDIT SUSv3 N/A */ | ||
35 | /* BB_AUDIT GNU defects -- only option -n is supported. */ | ||
36 | |||
38 | #include "libbb.h" | 37 | #include "libbb.h" |
39 | 38 | ||
39 | #define ESC "\033" | ||
40 | |||
40 | // procps 2.0.18: | 41 | // procps 2.0.18: |
41 | // watch [-d] [-n seconds] | 42 | // watch [-d] [-n seconds] |
42 | // [--differences[=cumulative]] [--interval=seconds] command | 43 | // [--differences[=cumulative]] [--interval=seconds] command |
@@ -77,7 +78,7 @@ int watch_main(int argc UNUSED_PARAM, char **argv) | |||
77 | header = NULL; | 78 | header = NULL; |
78 | while (1) { | 79 | while (1) { |
79 | /* home; clear to the end of screen */ | 80 | /* home; clear to the end of screen */ |
80 | printf("\033[H""\033[J"); | 81 | printf(ESC"[H" ESC"[J"); |
81 | if (!(opt & 0x2)) { // no -t | 82 | if (!(opt & 0x2)) { // no -t |
82 | const unsigned time_len = sizeof("1234-67-90 23:56:89"); | 83 | const unsigned time_len = sizeof("1234-67-90 23:56:89"); |
83 | 84 | ||