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).
This commit is contained in:
parent
a1c1935fa8
commit
7d9cbdec8f
@ -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? */
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user