--- linux/kernel/chr_drv/vt.c 2018/04/24 18:08:17 1.1 +++ linux/kernel/chr_drv/vt.c 2018/04/24 18:13:45 1.1.1.3 @@ -1,31 +1,29 @@ /* * kernel/chr_drv/vt.c * - * (C) 1992 obz under the linux copyright + * Copyright (C) 1992 obz under the linux copyright */ -#include - -#include -#include -#include - -#include -#include - +#include +#include #include #include +#include #include +#include +#include + #include "vt_kern.h" +#include +#include /* * console (vt and kd) routines, as defined by usl svr4 manual */ -struct vt_cons vt_cons[MAX_CONSOLES]; +struct vt_cons vt_cons[NR_CONSOLES]; -extern int NR_CONSOLES; extern unsigned char kleds; extern unsigned char kraw; extern unsigned char ke0; @@ -121,7 +119,17 @@ vt_ioctl(struct tty_struct *tty, int dev default: return -EINVAL; } - vt_cons[console].vt_mode = arg; + if (vt_cons[console].vt_mode == (unsigned char) arg) + return 0; + vt_cons[console].vt_mode = (unsigned char) arg; + if (console != fg_console) + return 0; + if (arg == KD_TEXT) + unblank_screen(); + else { + timer_active &= 1<read_q); - flush(tty->secondary); + flush_input(tty); return 0; case KDGKBMODE: verify_area((void *) arg, sizeof(unsigned long));