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 <peter.hutterer@who-t.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Julien Cristau <jcristau@debian.org>
This commit is contained in:
Peter Hutterer 2008-12-16 17:10:03 +10:00
parent 5d065a8890
commit aea6f19f25

View File

@ -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",