diff options
Diffstat (limited to 'toys/posix/sleep.c')
-rw-r--r-- | toys/posix/sleep.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/toys/posix/sleep.c b/toys/posix/sleep.c index 73f03fb4..0eb22702 100644 --- a/toys/posix/sleep.c +++ b/toys/posix/sleep.c @@ -11,7 +11,7 @@ config SLEEP bool "sleep" default y help - usage: sleep DURATION + usage: sleep DURATION... Wait before exiting. @@ -24,7 +24,10 @@ config SLEEP void sleep_main(void) { struct timespec ts; + char **args; - xparsetimespec(*toys.optargs, &ts); - toys.exitval = !!nanosleep(&ts, NULL); + for (args = toys.optargs; !toys.exitval && *args; args++) { + xparsetimespec(*args, &ts); + toys.exitval = !!nanosleep(&ts, NULL); + } } |