diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2012-08-20 09:18:38 -0700 |
---|---|---|
committer | android code review <noreply-gerritcodereview@google.com> | 2012-08-20 09:18:38 -0700 |
commit | 7c386a610d9164c12932452d1ff671e070956ec1 (patch) | |
tree | 8b8b400ec9e42493c65dbbf887770a20b1ba2c9a | |
parent | 36b1399d8cee09d4ffde3bf958322ab9556b8ebe (diff) | |
parent | 96d0a4dda81aaff3f72b9690d88eb40387ee9630 (diff) | |
download | system_core-7c386a610d9164c12932452d1ff671e070956ec1.zip system_core-7c386a610d9164c12932452d1ff671e070956ec1.tar.gz system_core-7c386a610d9164c12932452d1ff671e070956ec1.tar.bz2 |
Merge "Extend and document the "wait" command"
-rw-r--r-- | init/builtins.c | 6 | ||||
-rw-r--r-- | init/readme.txt | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/init/builtins.c b/init/builtins.c index 5bda7a0..882ceb5 100644 --- a/init/builtins.c +++ b/init/builtins.c @@ -799,6 +799,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; } diff --git a/init/readme.txt b/init/readme.txt index df524a6..fe0d15d 100644 --- a/init/readme.txt +++ b/init/readme.txt @@ -207,6 +207,11 @@ trigger <event> Trigger an event. Used to queue an action from another action. +wait <path> [ <timeout> ] + Poll for the existence of the given file and return when found, + or the timeout has been reached. If timeout is not specified it + currently defaults to five seconds. + write <path> <string> [ <string> ]* Open the file at <path> and write one or more strings to it with write(2) |