diff options
author | Sascha Hauer <sha@octopus.labnet.pengutronix.de> | 2007-10-04 18:35:53 +0200 |
---|---|---|
committer | Sascha Hauer <sha@octopus.labnet.pengutronix.de> | 2007-10-04 18:35:53 +0200 |
commit | 6905ed5bf3fcea60dcf173743c0ba363b4c05060 (patch) | |
tree | 6b8c9f9fdcdc24df309994dd09df944f52c6ef09 /commands | |
parent | c20d1208eb0dda4f398301422f7c0c0975518fba (diff) | |
download | barebox-6905ed5bf3fcea60dcf173743c0ba363b4c05060.tar.gz barebox-6905ed5bf3fcea60dcf173743c0ba363b4c05060.tar.xz |
timeout command: Use do {} while; insteal of while {}; to allow interrupt
with timeout = 0.
Diffstat (limited to 'commands')
-rw-r--r-- | commands/timeout.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/commands/timeout.c b/commands/timeout.c index 5368bc4427..aae0f73342 100644 --- a/commands/timeout.c +++ b/commands/timeout.c @@ -73,7 +73,7 @@ static int do_timeout(cmd_tbl_t *cmdtp, int argc, char *argv[]) if (!(flags & TIMEOUT_SILENT)) printf("%2d", countdown--); - while (!is_timeout(start, timeout * SECOND)) { + do { if (tstc()) { int key = getc(); if (flags & TIMEOUT_CTRLC && key == 3) @@ -87,7 +87,7 @@ static int do_timeout(cmd_tbl_t *cmdtp, int argc, char *argv[]) printf("\b\b%2d", countdown--); second += SECOND; } - } + } while (!is_timeout(start, timeout * SECOND)); ret = 0; out: |