Skip to content

Commit

Permalink
Pause on callback failures
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Matthew Garrett committed Oct 18, 2012
1 parent 7127b1a commit 310ec75
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions MokManager.c
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 310ec75

Please sign in to comment.