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.
This commit is contained in:
Matthew Garrett 2012-10-17 18:23:35 -04:00
parent 7127b1abc9
commit 310ec753fa

View File

@ -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;