Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 96d0a4dd authored by Patrick McCormick's avatar Patrick McCormick Committed by Andrew Boie
Browse files

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: default avatarAndrew Boie <andrew.p.boie@intel.com>
parent ec7d9dc7
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -813,6 +813,8 @@ int do_wait(int nargs, char **args)
{
    if (nargs == 2) {
        return wait_for_file(args[1], COMMAND_RETRY_TIMEOUT);
    }
    } else if (nargs == 3) {
        return wait_for_file(args[1], atoi(args[2]));
    } else
        return -1;
}
+5 −0
Original line number Diff line number Diff line
@@ -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)