Pause the execution (10s max) if any errors are displayed so the user
has a chance to see them. * grub-core/kern/err.c (grub_err_printed_errors): New variable. (grub_print_error): Increment grub_err_printed_errors. * grub-core/normal/menu.c (grub_menu_execute_entry): Pause the execution if any errors were displayed. (show_menu): Remove old code for pause. * grub-core/normal/menu_entry.c (run): Likewise. * grub-core/normal/term.c (grub_normal_char_counter): Removed. All users updated. (grub_normal_get_char_counter): Likewise. * include/grub/err.h (grub_err_printed_errors): New external variable. * include/grub/normal.h (grub_normal_get_char_counter): Removed.
This commit is contained in:
parent
f218b09c99
commit
38c259a76a
7 changed files with 37 additions and 32 deletions
|
@ -158,6 +158,7 @@ void
|
|||
grub_menu_execute_entry(grub_menu_entry_t entry)
|
||||
{
|
||||
grub_err_t err = GRUB_ERR_NONE;
|
||||
int errs_before;
|
||||
|
||||
if (entry->restricted)
|
||||
err = grub_auth_check_authentication (entry->users);
|
||||
|
@ -169,9 +170,14 @@ grub_menu_execute_entry(grub_menu_entry_t entry)
|
|||
return;
|
||||
}
|
||||
|
||||
errs_before = grub_err_printed_errors;
|
||||
|
||||
grub_env_set ("chosen", entry->title);
|
||||
grub_script_execute_sourcecode (entry->sourcecode, entry->argc, entry->args);
|
||||
|
||||
if (errs_before != grub_err_printed_errors)
|
||||
grub_wait_after_message ();
|
||||
|
||||
if (grub_errno == GRUB_ERR_NONE && grub_loader_is_loaded ())
|
||||
/* Implicit execution of boot, only if something is loaded. */
|
||||
grub_command_execute ("boot", 0, 0);
|
||||
|
@ -583,20 +589,9 @@ show_menu (grub_menu_t menu, int nested)
|
|||
grub_cls ();
|
||||
|
||||
if (auto_boot)
|
||||
{
|
||||
grub_menu_execute_with_fallback (menu, e, &execution_callback, 0);
|
||||
}
|
||||
grub_menu_execute_with_fallback (menu, e, &execution_callback, 0);
|
||||
else
|
||||
{
|
||||
int chars_before = grub_normal_get_char_counter ();
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
grub_menu_execute_entry (e);
|
||||
grub_print_error ();
|
||||
grub_errno = GRUB_ERR_NONE;
|
||||
|
||||
if (chars_before != grub_normal_get_char_counter ())
|
||||
grub_wait_after_message ();
|
||||
}
|
||||
grub_menu_execute_entry (e);
|
||||
}
|
||||
|
||||
return GRUB_ERR_NONE;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue