From 7d9cbdec8fe640ae357d96868b5f93ca8f52ae60 Mon Sep 17 00:00:00 2001 From: Peter Wemm Date: Sun, 11 Oct 1998 10:07:52 +0000 Subject: [PATCH] Only call vidc_init() once (unless forced). Cosmetic change to the init-time character eater (like, make it increment the index counter - if there's a problem, it would sit there in an infinite loop instead of only running 10 times). --- sys/boot/i386/libi386/vidconsole.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/sys/boot/i386/libi386/vidconsole.c b/sys/boot/i386/libi386/vidconsole.c index 5ee09aea619..c67cd72061b 100644 --- a/sys/boot/i386/libi386/vidconsole.c +++ b/sys/boot/i386/libi386/vidconsole.c @@ -26,7 +26,7 @@ * * From Id: probe_keyboard.c,v 1.13 1997/06/09 05:10:55 bde Exp * - * $Id: vidconsole.c,v 1.4 1998/10/07 02:39:06 msmith Exp $ + * $Id: vidconsole.c,v 1.5 1998/10/07 07:34:31 msmith Exp $ */ #include @@ -46,6 +46,8 @@ static void vidc_putchar(int c); static int vidc_getchar(void); static int vidc_ischar(void); +static int vidc_started; + struct console vidconsole = { "vidconsole", "internal video/keyboard", @@ -77,9 +79,12 @@ vidc_probe(struct console *cp) static int vidc_init(int arg) { - int i = 0; + int i; - while((i < 10) && (vidc_ischar())) + if (vidc_started && arg == 0) + return; + vidc_started = 1; + for(i = 0; i < 10 && vidc_ischar(); i++) (void)vidc_getchar(); return(0); /* XXX reinit? */ }