timeout to avoid indefinite boot stalling.
+2010-08-30 Vladimir Serbinenko <phcoder@gmail.com>
+
+ * grub-core/normal/menu.c (grub_wait_after_message): Add a 10 second
+ timeout to avoid indefinite boot stalling.
+
2010-08-30 Vladimir Serbinenko <phcoder@gmail.com>
* grub-core/normal/color.c (grub_env_write_color_normal): Fix a warning.
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");
}