summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-07-20 09:00:18 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-07-28 09:45:18 +1000
commit50a7361cfcb9ef361afe77e283f4fd2a5b6214f5 (patch)
treeaee84190216e159ff21740c7d57af3e29bde365d
parent2d94a7d8c2223243fd860bd01f6fdeff91856679 (diff)
Initialize the fd to -1 for xorg.conf input devices.server-1.10-input
For hotplugged devices, xf86AllocateInput does that for us but the xorg.conf path is different. Since not all drivers reset the fd during PreInit but may still call close(pInfo->fd) in all cases, this can terminate the logging early. Reproducible: add a wacom driver InputDevice section with no Option Device. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Daniel Stone <daniel@fooishbar.org> (cherry picked from commit 3798dd379c1ecf325f9907128fb66d20372f6876)
-rw-r--r--hw/xfree86/common/xf86Config.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 114bdc3a3..58b30dd68 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -1222,6 +1222,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
devs = xnfrealloc(servlayoutp->inputs,
(count + 1) * sizeof(InputInfoPtr));
devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
+ Pointer.fd = -1;
*devs[count - 1] = Pointer;
devs[count - 1]->options =
xf86addNewOption(devs[count -1]->options,
@@ -1267,6 +1268,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
devs = xnfrealloc(servlayoutp->inputs,
(count + 1) * sizeof(InputInfoPtr));
devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
+ Pointer.fd = -1;
*devs[count - 1] = Pointer;
devs[count - 1]->options =
xf86addNewOption(NULL, xnfstrdup("AlwaysCore"), NULL);
@@ -1363,6 +1365,7 @@ checkCoreInputDevices(serverLayoutPtr servlayoutp, Bool implicitLayout)
devs = xnfrealloc(servlayoutp->inputs,
(count + 1) * sizeof(InputInfoPtr));
devs[count - 1] = xnfalloc(sizeof(InputInfoRec));
+ Keyboard.fd = -1;
*devs[count - 1] = Keyboard;
devs[count - 1]->options =
xf86addNewOption(devs[count - 1]->options,