From 8a3b34897083fc28742a10e9900a7511beaccd8e Mon Sep 17 00:00:00 2001 From: Kazutaka YOKOTA Date: Mon, 16 Jul 2001 05:21:24 +0000 Subject: MFC: - syscons.c rev 1.361 Test "sc->kbd != NULL" rather than "sc != NULL" before accessing the keyboard in scopen(). - syscons.c rev 1.363 If we are in DDB, don't switch to a vty in the VT_PROCESS mode. - syscons.h rev 1.68, scvtb.c rev 1.8 Don't free buffers we didn't allocate. - scmouse.c rev 1.24 Quit the ioctl MOUSE_GETINFO as soon as we have gathered necessary information. There is no need to stick around any longer. --- sys/dev/syscons/syscons.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'sys/dev/syscons/syscons.c') diff --git a/sys/dev/syscons/syscons.c b/sys/dev/syscons/syscons.c index 7fda42fd3b6d..5b964e6a0b0e 100644 --- a/sys/dev/syscons/syscons.c +++ b/sys/dev/syscons/syscons.c @@ -474,7 +474,7 @@ scopen(dev_t dev, int flag, int mode, struct proc *p) ttychars(tp); /* Use the current setting of the <-- key as default VERASE. */ /* If the Delete key is preferable, an stty is necessary */ - if (sc != NULL) { + if (sc->kbd != NULL) { key.keynum = KEYCODE_BS; kbd_ioctl(sc->kbd, GIO_KEYMAPENT, (caddr_t)&key); tp->t_cc[VERASE] = key.key.map[0]; @@ -2217,6 +2217,7 @@ sc_switch_scr(sc_softc_t *sc, u_int next_scr) /* * Is the wanted vty open? Don't allow switching to a closed vty. + * If we are in DDB, don't switch to a vty in the VT_PROCESS mode. * Note that we always allow the user to switch to the kernel * console even if it is closed. */ @@ -2228,6 +2229,11 @@ sc_switch_scr(sc_softc_t *sc, u_int next_scr) DPRINTF(5, ("error 2, requested vty isn't open!\n")); return EINVAL; } + if ((debugger > 0) && (SC_STAT(tp->t_dev)->smode.mode == VT_PROCESS)) { + splx(s); + DPRINTF(5, ("error 3, requested vty is in the VT_PROCESS mode\n")); + return EINVAL; + } } /* this is the start of vty switching process... */ -- cgit v1.3