diff options
author | Jeremy Kerr <jk@ozlabs.org> | 2014-04-22 10:41:59 +0800 |
---|---|---|
committer | Jeremy Kerr <jk@ozlabs.org> | 2014-04-22 10:44:09 +0800 |
commit | 85421290c797c59320bf1e9f076f46195115ab92 (patch) | |
tree | e911c0bcc99961fbc5decd52d5a0588691613e22 /ui/ncurses/nc-cui.c | |
parent | b6ee414890fcd582a96f4d89e648cff5dacb1cb9 (diff) | |
download | petitboot-85421290c797c59320bf1e9f076f46195115ab92.zip petitboot-85421290c797c59320bf1e9f076f46195115ab92.tar.gz |
ui/ncurses: only cancel default boot on valid key events
We're seeing occasionaly failures to autoboot due to supirious key
events (getch() returing -1) on an IPMI console.
This change modifies the process_key logic to only abort the default if
we see a valid key event.
Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Diffstat (limited to 'ui/ncurses/nc-cui.c')
-rw-r--r-- | ui/ncurses/nc-cui.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ui/ncurses/nc-cui.c b/ui/ncurses/nc-cui.c index 5f56409..7200a81 100644 --- a/ui/ncurses/nc-cui.c +++ b/ui/ncurses/nc-cui.c @@ -327,10 +327,6 @@ static int cui_process_key(void *arg) assert(cui->current); - if (!cui->has_input) - discover_client_cancel_default(cui->client); - cui->has_input = true; - for (;;) { int c = getch(); @@ -339,6 +335,13 @@ static int cui_process_key(void *arg) if (c == ERR) break; + if (!cui->has_input) { + pb_log("UI input received (key = %d), aborting " + "default boot\n", c); + discover_client_cancel_default(cui->client); + cui->has_input = true; + } + if (process_global_keys(cui, c)) continue; |