xserver/hw/xfree86/os-support/linux
Tomáš Trnka 323869f329 Fix drain_console unregistration
Bug introduced by 9dca441670
xfree86: add a hook to replace the new console handler.

console_handler was not being set, making the server eat up CPU spinning
in WaitForSomething selecting consoleFd over and over again, every time
trying to unregister drain_console without success due to
console_handler being NULL.

Let's just fix the unregistration in xf86SetConsoleHandler() and use that.

But wait, there could be a catch: If some driver replaced the handler using
xf86SetConsoleHandler(), the unregistration in xf86CloseConsole will unregister
that one. I don't understand Xorg well enough to know whether this poses a
problem (could mess up driver deinit somehow or something like that). As it is,
xf86SetConsoleHandler() doesn't offer any way to prevent this (i.e. check which
handler is currently registered).

I had been using it for two days on my machine that previously hit 100% CPU
several times a day. That has now gone away without any new problems appearing.

Signed-off-by: Tomas Trnka <tomastrnka@gmx.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
2011-10-18 09:15:54 +10:00
..
int10 Replace X-allocation functions with their C89 counterparts 2010-05-13 00:22:37 +07:00
Makefile.am Remove lnx_font.c and lnx.h 2009-11-06 06:23:26 -08:00
lnx_acpi.c xfree86: Remove superfluous ifdef DEBUG checks. 2009-05-16 12:20:57 +10:00
lnx_agp.c linux: warning fix 2010-12-31 12:52:50 +00:00
lnx_apm.c Remove lnx_font.c and lnx.h 2009-11-06 06:23:26 -08:00
lnx_axp.c Use glibc's in/out routines 2009-11-16 20:17:29 -08:00
lnx_bell.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
lnx_ev56.c Use glibc's in/out routines 2009-11-16 20:17:29 -08:00
lnx_init.c Fix drain_console unregistration 2011-10-18 09:15:54 +10:00
lnx_kmod.c Rework symbol visibility for easier maintenance 2008-12-03 05:43:34 -02:00
lnx_video.c XFree86: Linux: AGP: Fix void-pointer-arithmetic warning 2010-12-31 12:52:51 +00:00