From 3798dd379c1ecf325f9907128fb66d20372f6876 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 20 Jul 2011 09:00:18 +1000 Subject: [PATCH] Initialize the fd to -1 for xorg.conf input devices. 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 Reviewed-by: Daniel Stone --- hw/xfree86/common/xf86Config.c | 3 +++ 1 file changed, 3 insertions(+) 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,