1303 files changed, 32187 insertions, 57138 deletions
diff --git a/procps/watch.c b/procps/watch.c index 0397f21..bb34124 100644 --- a/procps/watch.c +++ b/procps/watch.c @@ -11,6 +11,17 @@ /* BB_AUDIT SUSv3 N/A */ /* BB_AUDIT GNU defects -- only option -n is supported. */ +//config:config WATCH +//config: bool "watch" +//config: default y +//config: help +//config: watch is used to execute a program periodically, showing +//config: output to the screen. + +//applet:IF_WATCH(APPLET(watch, BB_DIR_BIN, BB_SUID_DROP)) + +//kbuild:lib-$(CONFIG_WATCH) += watch.o + //usage:#define watch_trivial_usage //usage: "[-n SEC] [-t] PROG ARGS" //usage:#define watch_full_usage "\n\n" @@ -51,9 +62,9 @@ int watch_main(int argc UNUSED_PARAM, char **argv) xopen("/dev/null", O_RDONLY); #endif - opt_complementary = "-1:n+"; // at least one param; -n NUM + opt_complementary = "-1"; // at least one param; -n NUM // "+": stop at first non-option (procps 3.x only) - opt = getopt32(argv, "+dtn:", &period); + opt = getopt32(argv, "+dtn:+", &period); argv += optind; // watch from both procps 2.x and 3.x does concatenation. Example: @@ -72,7 +83,7 @@ int watch_main(int argc UNUSED_PARAM, char **argv) // STDERR_FILENO is procps3 compat: // "watch ls 2>/dev/null" does not detect tty size - get_terminal_width_height(STDERR_FILENO, &new_width, NULL); + new_width = get_terminal_width(STDERR_FILENO); if (new_width != width) { width = new_width; free(header); |