diff options
Diffstat (limited to 'sleep.c')
-rw-r--r-- | sleep.c | 19 |
1 files changed, 9 insertions, 10 deletions
@@ -1,3 +1,4 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | ||
1 | /* | 2 | /* |
2 | * Mini sleep implementation for busybox | 3 | * Mini sleep implementation for busybox |
3 | * | 4 | * |
@@ -23,19 +24,17 @@ | |||
23 | #include "internal.h" | 24 | #include "internal.h" |
24 | #include <stdio.h> | 25 | #include <stdio.h> |
25 | 26 | ||
26 | const char sleep_usage[] = "sleep N\n\n" | 27 | const char sleep_usage[] = "sleep N\n\n" "Pause for N seconds.\n"; |
27 | "Pause for N seconds.\n"; | ||
28 | 28 | ||
29 | extern int | 29 | extern int sleep_main(int argc, char **argv) |
30 | sleep_main(int argc, char * * argv) | ||
31 | { | 30 | { |
32 | if ( (argc < 2) || (**(argv+1) == '-') ) { | 31 | if ((argc < 2) || (**(argv + 1) == '-')) { |
33 | usage( sleep_usage ); | 32 | usage(sleep_usage); |
34 | } | 33 | } |
35 | 34 | ||
36 | if ( sleep(atoi(*(++argv))) != 0 ) { | 35 | if (sleep(atoi(*(++argv))) != 0) { |
37 | perror( "sleep"); | 36 | perror("sleep"); |
38 | exit (FALSE); | 37 | exit(FALSE); |
39 | } else | 38 | } else |
40 | exit (TRUE); | 39 | exit(TRUE); |
41 | } | 40 | } |