From 96d0a4dda81aaff3f72b9690d88eb40387ee9630 Mon Sep 17 00:00:00 2001 From: Patrick McCormick Date: Fri, 4 Feb 2011 10:51:39 -0800 Subject: Extend and document the "wait" command The wait command was currently implemented but undocumented and only used internally. This change adds a second option toi (optionally) override the default timeout of 5 seconds. The wait command can be used to wait for a file to appear during the boot process, for example a disk or other device, and is a better alternative than an unconditional sleep. Change-Id: Ia11d8419c0ea84deec0e1bf5adfca5bc76ff38b7 Signed-off-by: Andrew Boie --- init/builtins.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'init/builtins.c') diff --git a/init/builtins.c b/init/builtins.c index ac9585e8..6d3ed251 100644 --- a/init/builtins.c +++ b/init/builtins.c @@ -813,6 +813,8 @@ int do_wait(int nargs, char **args) { if (nargs == 2) { return wait_for_file(args[1], COMMAND_RETRY_TIMEOUT); - } - return -1; + } else if (nargs == 3) { + return wait_for_file(args[1], atoi(args[2])); + } else + return -1; } -- cgit v1.2.3