summaryrefslogtreecommitdiffstats
path: root/commands/timeout.c
diff options
context:
space:
mode:
authorSascha Hauer <sha@octopus.labnet.pengutronix.de>2007-10-04 18:35:53 +0200
committerSascha Hauer <sha@octopus.labnet.pengutronix.de>2007-10-04 18:35:53 +0200
commit6905ed5bf3fcea60dcf173743c0ba363b4c05060 (patch)
tree6b8c9f9fdcdc24df309994dd09df944f52c6ef09 /commands/timeout.c
parentc20d1208eb0dda4f398301422f7c0c0975518fba (diff)
downloadbarebox-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/timeout.c')
-rw-r--r--commands/timeout.c4
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: