summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary Ching-Pang Lin <glin@suse.com>2013-01-03 12:20:30 +0800
committerGary Ching-Pang Lin <glin@suse.com>2013-01-03 12:20:30 +0800
commit4a88de5816a7ac416d30dbd66e5117f5d4c2c74d (patch)
treeaf07acb08b036699084c550be0de6da72453c41c
parent92a136d823e211b60656872ee43ade8693057ee1 (diff)
downloadefi-boot-shim-4a88de5816a7ac416d30dbd66e5117f5d4c2c74d.tar.gz
efi-boot-shim-4a88de5816a7ac416d30dbd66e5117f5d4c2c74d.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;