From 8ede066388136845da1a79027a330ed4c4a24d33 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Thu, 2 Sep 2010 10:53:28 +0200 Subject: [PATCH] linux: Don't lose console events on non-evdev drivers. The drain_console() function will race with new keyboard events being added by the hardware causing the server to lose keyboard events if the console fd is used for input. Signed-off-by: Thomas Hellstrom --- hw/xfree86/os-support/linux/lnx_init.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-) diff --git a/hw/xfree86/os-support/linux/lnx_init.c b/hw/xfree86/os-support/linux/lnx_init.c index 7f40857..2d77703 100644 --- a/hw/xfree86/os-support/linux/lnx_init.c +++ b/hw/xfree86/os-support/linux/lnx_init.c @@ -303,8 +303,9 @@ xf86OpenConsole(void) tcsetattr(xf86Info.consoleFd, TCSANOW, &nTty); /* need to keep the buffer clean, else the kernel gets angry */ - console_handler = xf86AddGeneralHandler(xf86Info.consoleFd, - drain_console, NULL); + if (xf86Info.allowEmptyInput) + console_handler = xf86AddGeneralHandler(xf86Info.consoleFd, + drain_console, NULL); /* we really should have a InitOSInputDevices() function instead * of Init?$#*&Device(). So I just place it here */ -- 1.6.2.5