diff options
Diffstat (limited to 'coreutils/usleep.c')
-rw-r--r-- | coreutils/usleep.c | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/coreutils/usleep.c b/coreutils/usleep.c index ac268b485..f570f2734 100644 --- a/coreutils/usleep.c +++ b/coreutils/usleep.c | |||
@@ -1,8 +1,8 @@ | |||
1 | /* vi: set sw=4 ts=4: */ | 1 | /* vi: set sw=4 ts=4: */ |
2 | /* | 2 | /* |
3 | * Mini usleep implementation for busybox | 3 | * usleep implementation for busybox |
4 | * | 4 | * |
5 | * Copyright (C) 1995, 1996 by Bruce Perens <bruce@pixar.com>. | 5 | * Copyright (C) 2003 Manuel Novoa III <mjn3@codepoet.org> |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
8 | * it under the terms of the GNU General Public License as published by | 8 | * it under the terms of the GNU General Public License as published by |
@@ -20,18 +20,22 @@ | |||
20 | * | 20 | * |
21 | */ | 21 | */ |
22 | 22 | ||
23 | /* getopt not needed */ | 23 | /* BB_AUDIT SUSv3 N/A -- Apparently a busybox extension. */ |
24 | 24 | ||
25 | #include <stdlib.h> | 25 | #include <stdlib.h> |
26 | #include <limits.h> | ||
26 | #include <unistd.h> | 27 | #include <unistd.h> |
27 | #include "busybox.h" | 28 | #include "busybox.h" |
28 | 29 | ||
29 | extern int usleep_main(int argc, char **argv) | 30 | extern int usleep_main(int argc, char **argv) |
30 | { | 31 | { |
31 | if ((argc < 2) || (**(argv + 1) == '-')) { | 32 | if (argc != 2) { |
32 | show_usage(); | 33 | bb_show_usage(); |
34 | } | ||
35 | |||
36 | if (usleep(bb_xgetularg10_bnd(argv[1], 0, UINT_MAX))) { | ||
37 | bb_perror_nomsg_and_die(); | ||
33 | } | 38 | } |
34 | 39 | ||
35 | usleep(atoi(*(++argv))); /* return void */ | ||
36 | return EXIT_SUCCESS; | 40 | return EXIT_SUCCESS; |
37 | } | 41 | } |