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:
Vladimir 'phcoder' Serbinenko 2010-09-20 17:46:35 +02:00
parent f218b09c99
commit 38c259a76a
7 changed files with 37 additions and 32 deletions

View file

@ -1161,6 +1161,7 @@ run (struct screen *screen)
{
int currline = 0;
char *nextline;
int errs_before;
auto grub_err_t editor_getline (char **line, int cont);
grub_err_t editor_getline (char **line, int cont __attribute__ ((unused)))
@ -1194,6 +1195,7 @@ run (struct screen *screen)
grub_printf_ (N_("Booting a command list"));
grub_printf ("\n\n");
errs_before = grub_err_printed_errors;
/* Execute the script, line for line. */
while (currline < screen->num_lines)
@ -1203,6 +1205,9 @@ run (struct screen *screen)
break;
}
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);
@ -1382,13 +1387,7 @@ grub_menu_entry_run (grub_menu_entry_t entry)
case GRUB_TERM_CTRL | 'x':
case GRUB_TERM_KEY_F10:
{
int chars_before = grub_normal_get_char_counter ();
run (screen);
if (chars_before != grub_normal_get_char_counter ())
grub_wait_after_message ();
}
run (screen);
goto refresh;
case GRUB_TERM_CTRL | 'r':