From 8920a08d8794d4f3c6d6a529461a70ac5e1809a5 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 30 Aug 2010 01:14:07 +0200 Subject: [PATCH] * grub-core/normal/menu.c (grub_wait_after_message): Add a 10 second timeout to avoid indefinite boot stalling. --- ChangeLog | 5 +++++ grub-core/normal/menu.c | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1f7bbfa6c..095cec7f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2010-08-30 Vladimir Serbinenko + + * grub-core/normal/menu.c (grub_wait_after_message): Add a 10 second + timeout to avoid indefinite boot stalling. + 2010-08-30 Vladimir Serbinenko * grub-core/normal/color.c (grub_env_write_color_normal): Fix a warning. diff --git a/grub-core/normal/menu.c b/grub-core/normal/menu.c index b57990b0d..cc84ce38c 100644 --- a/grub-core/normal/menu.c +++ b/grub-core/normal/menu.c @@ -43,9 +43,20 @@ grub_err_t (*grub_gfxmenu_try_hook) (int entry, grub_menu_t menu, void grub_wait_after_message (void) { + grub_uint64_t endtime; grub_xputs ("\n"); grub_printf_ (N_("Press any key to continue...")); - (void) grub_getkey (); + grub_refresh (); + + endtime = grub_get_time_ms () + 10000; + + while (grub_get_time_ms () < endtime) + if (grub_checkkey () >= 0) + { + grub_getkey (); + break; + } + grub_xputs ("\n"); }