From aea6f19f25e13768b1d09fac4991d6a5e6c2cdac Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Tue, 16 Dec 2008 17:10:03 +1000 Subject: [PATCH] xfree86: don't restore the TTY mode if we didn't initialize it ourselves Restoring it unconditionally means we restore to whatever tty_mode has as default value (i.e. 0). K_RAW happens to be 0x00, so we always restore to raw mode if allowEmptyInput is off. Signed-off-by: Peter Hutterer Signed-off-by: Adam Jackson Signed-off-by: Julien Cristau --- hw/xfree86/os-support/linux/lnx_init.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c index da5ca57cc..6ee8ed6bd 100644 --- a/hw/xfree86/os-support/linux/lnx_init.c +++ b/hw/xfree86/os-support/linux/lnx_init.c @@ -376,8 +376,10 @@ xf86CloseConsole() xf86Msg(X_WARNING, "xf86CloseConsole: KDSETMODE failed: %s\n", strerror(errno)); - ioctl(xf86Info.consoleFd, KDSKBMODE, tty_mode); - tcsetattr(xf86Info.consoleFd, TCSANOW, &tty_attr); + if (xf86Info.allowEmptyInput) { + ioctl(xf86Info.consoleFd, KDSKBMODE, tty_mode); + tcsetattr(xf86Info.consoleFd, TCSANOW, &tty_attr); + } if (ioctl(xf86Info.consoleFd, VT_GETMODE, &VT) < 0) xf86Msg(X_WARNING, "xf86CloseConsole: VT_GETMODE failed: %s\n",