summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Ching-Pang Lin <glin@suse.com>2012-12-26 11:44:46 +0800
committerGary Ching-Pang Lin <glin@suse.com>2013-01-03 12:20:30 +0800
commit4bab48ce880964b3ee709b5acd565160dbf9ff19 (patch)
treeaf07acb08b036699084c550be0de6da72453c41c
parent990dcdb6a6cea2a22ef237b68630aa30784184c4 (diff)
downloadefi-boot-shim-4bab48ce880964b3ee709b5acd565160dbf9ff19.tar.gz
efi-boot-shim-4bab48ce880964b3ee709b5acd565160dbf9ff19.zip
Make sure the menu shows when the callback fails
Since Pause() doesn't clear the key from the input queue, the next ReadKeyStroke reads the queued key instead of the new one. If the user presses "Enter", MokManager exits directly without showing the menu again.
-rw-r--r--MokManager.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/MokManager.c b/MokManager.c
index bfcbfd67..97588cb6 100644
--- a/MokManager.c
+++ b/MokManager.c
@@ -1241,6 +1241,9 @@ static void run_menu (CHAR16 *header, UINTN lines, struct menu_item *items,
if (ret < 0) {
Print(L"Press a key to continue\n");
Pause();
+ /* Clear the key in the queue */
+ uefi_call_wrapper(ST->ConIn->ReadKeyStroke, 2,
+ ST->ConIn, &key);
}
draw_menu (header, lines, items, count);
pos = 0;