Finalize the middle button emulation when a read error occurs (#23048)

If a read error occurs, remove the block and wakeup handlers for middle
mouse button emulation. Otherwise, they'll still be around after the device
has been reopened and overwritten with the new ones created by EvdevOn. Once
this happened, future removal of the device can lead to a server crash.

X.Org Bug 23048 <http://bugs.freedesktop.org/show_bug.cgi?id=23048>

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
(cherry picked from commit f2dc0681fe)
This commit is contained in:
Peter Hutterer
2009-10-06 19:09:33 +10:00
parent cd24c2cc18
commit 5a4b0ba33d

View File

@@ -576,6 +576,7 @@ EvdevReadInput(InputInfoPtr pInfo)
{
if (errno == ENODEV) /* May happen after resume */
{
EvdevMBEmuFinalize(pInfo);
xf86RemoveEnabledDevice(pInfo);
close(pInfo->fd);
pInfo->fd = -1;