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.
---
 hw/xfree86/os-support/linux/lnx_init.c |    6 ++++--
 1 files 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 da5ca57..6ee8ed6 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",
-- 
1.6.0.4

_______________________________________________
xorg mailing list
xorg@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/xorg

Reply via email to