summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>1998-10-11 10:07:52 +0000
committerpeter <peter@FreeBSD.org>1998-10-11 10:07:52 +0000
commit000dea089b69ac4d12c2e866ee33c8feac228813 (patch)
treecac31f713e573f9928bea217e29361e472f857cc
parentea08aa40134629a9b1f5d3ed141fca25d43c565c (diff)
downloadFreeBSD-src-000dea089b69ac4d12c2e866ee33c8feac228813.zip
FreeBSD-src-000dea089b69ac4d12c2e866ee33c8feac228813.tar.gz
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).
-rw-r--r--sys/boot/i386/libi386/vidconsole.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/sys/boot/i386/libi386/vidconsole.c b/sys/boot/i386/libi386/vidconsole.c
index 5ee09ae..c67cd72 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 <stand.h>
@@ -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? */
}
OpenPOWER on IntegriCloud