xserver/hw
Tomáš Trnka a3dfc9c913 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>
(cherry picked from commit 323869f329)
(cherry picked from commit 82445286d5)
2011-10-26 00:49:13 -07:00
..
dmx glx: Remove a few lingering traces of __GLXscreen.GLXVersion 2011-07-16 13:19:27 -07:00
kdrive Xephyr/dri: register screen and window privates on init 2011-08-10 14:58:29 -07:00
vfb man: refactor common code in the man pages makefiles 2011-01-18 15:11:10 -08:00
xfree86 Fix drain_console unregistration 2011-10-26 00:49:13 -07:00
xnest man: refactor common code in the man pages makefiles 2011-01-18 15:11:10 -08:00
xquartz XQuartz: Use set_front_process rather than X11ApplicationSetFrontProcess since we're already in the AppKit thread 2011-10-18 09:13:25 -07:00
xwin glx: Remove a few lingering traces of __GLXscreen.GLXVersion 2011-07-16 13:19:27 -07:00
Makefile.am Catch errors in recursive relink targets 2010-03-22 00:45:57 -05:00