From 6905ed5bf3fcea60dcf173743c0ba363b4c05060 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Thu, 4 Oct 2007 18:35:53 +0200 Subject: timeout command: Use do {} while; insteal of while {}; to allow interrupt with timeout = 0. --- commands/timeout.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'commands/timeout.c') 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: -- cgit v1.2.3