aboutsummaryrefslogtreecommitdiff
path: root/coreutils/usleep.c
diff options
context:
space:
mode:
authormjn3 <mjn3@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-03-19 09:13:01 +0000
committermjn3 <mjn3@69ca8d6d-28ef-0310-b511-8ec308f3f277>2003-03-19 09:13:01 +0000
commite901c15d890dbbdce4c086963cb1513653fc46b5 (patch)
treea318d0f03aa076c74b576ea45dc543a5669e8e91 /coreutils/usleep.c
parent40758c00616c3b2c85d83eb4afdeb04b1f65c9f1 (diff)
downloadbusybox-w32-e901c15d890dbbdce4c086963cb1513653fc46b5.tar.gz
busybox-w32-e901c15d890dbbdce4c086963cb1513653fc46b5.tar.bz2
busybox-w32-e901c15d890dbbdce4c086963cb1513653fc46b5.zip
Major coreutils update.
git-svn-id: svn://busybox.net/trunk/busybox@6751 69ca8d6d-28ef-0310-b511-8ec308f3f277
Diffstat (limited to 'coreutils/usleep.c')
-rw-r--r--coreutils/usleep.c16
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
29extern int usleep_main(int argc, char **argv) 30extern 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}