From d08ea5363cec6f0159112aec1658d57fbaf1e471 Mon Sep 17 00:00:00 2001 From: Matthew Garrett Date: Thu, 18 Oct 2012 17:43:53 -0400 Subject: [PATCH] Pause on callback failures If a callback returns any kind of failure, wait for a keypress in order to give the user an opportunity to read any failure messages. --- MokManager.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/MokManager.c b/MokManager.c index fb20352..88a08f7 100644 --- a/MokManager.c +++ b/MokManager.c @@ -819,6 +819,7 @@ static void run_menu (CHAR16 *header, UINTN lines, struct menu_item *items, UINTN index, pos = 0, wait = 0, offset; EFI_INPUT_KEY key; EFI_STATUS status; + INTN ret; if (timeout) wait = 10000000; @@ -885,8 +886,13 @@ static void run_menu (CHAR16 *header, UINTN lines, struct menu_item *items, return; } - items[pos].callback(items[pos].data, items[pos].data2, - items[pos].data3); + ret = items[pos].callback(items[pos].data, + items[pos].data2, + items[pos].data3); + if (ret < 0) { + Print(L"Press a key to continue\n"); + Pause(); + } draw_menu (header, lines, items, count); pos = 0; break;