diff options
author | Michael Brown | 2010-07-14 13:37:29 +0200 |
---|---|---|
committer | Michael Brown | 2010-07-14 13:43:10 +0200 |
commit | 3338a0398203ac7a5f0c8396c738032b890d710c (patch) | |
tree | b60940586f98a52aa095408843934efd8df83fbc /src/hci/shell_banner.c | |
parent | [davicom] Use iPXE debugging infrastructure (diff) | |
download | ipxe-3338a0398203ac7a5f0c8396c738032b890d710c.tar.gz ipxe-3338a0398203ac7a5f0c8396c738032b890d710c.tar.xz ipxe-3338a0398203ac7a5f0c8396c738032b890d710c.zip |
[hci] Continue processing while prompting for shell banner
Continue calling step() while displaying the shell banner. This
potentially allows TCP connections to close gracefully after a failed
boot attempt.
Inspired-by: Guo-Fu Tseng <cooldavid@cooldavid.org>
Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/hci/shell_banner.c')
-rw-r--r-- | src/hci/shell_banner.c | 16 |
1 files changed, 3 insertions, 13 deletions
diff --git a/src/hci/shell_banner.c b/src/hci/shell_banner.c index 07c0fa4a..dbfa8edf 100644 --- a/src/hci/shell_banner.c +++ b/src/hci/shell_banner.c @@ -20,9 +20,9 @@ FILE_LICENCE ( GPL2_OR_LATER ); #include <stdio.h> #include <console.h> -#include <unistd.h> #include <config/general.h> #include <ipxe/keys.h> +#include <ipxe/timer.h> #include <ipxe/shell_banner.h> /** @file @@ -37,8 +37,6 @@ FILE_LICENCE ( GPL2_OR_LATER ); * @ret enter_shell User wants to enter shell */ int shell_banner ( void ) { - int enter_shell = 0; - int wait_count; int key; /* Skip prompt if timeout is zero */ @@ -49,18 +47,10 @@ int shell_banner ( void ) { printf ( "\nPress Ctrl-B for the iPXE command line..." ); /* Wait for key */ - for ( wait_count = 0 ; wait_count < BANNER_TIMEOUT ; wait_count++ ) { - if ( iskey() ) { - key = getchar(); - if ( key == CTRL_B ) - enter_shell = 1; - break; - } - mdelay(100); - } + key = getchar_timeout ( ( BANNER_TIMEOUT * TICKS_PER_SEC ) / 10 ); /* Clear the "Press Ctrl-B" line */ printf ( "\r \r" ); - return enter_shell; + return ( key == CTRL_B ); } |