From d929ba6886c6f121b101c0bf0f7c63ef9d851a3e Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Fri, 26 Dec 2008 18:32:41 +1100 Subject: [PATCH] XFree86: Input: Fail NIDR if we can't enable devices If we can't enable a device, bail out of NewInputDeviceRequest rather than blithely continuing. Also, be more verbose when initialization failed. Also, be more verbose when initialization failed. Also, be more verbose when initialization failed. Also, be more verbose when initialization failed. Signed-off-by: Daniel Stone Signed-off-by: Peter Hutterer --- hw/xfree86/common/xf86Xinput.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index 413ef036d..d5d06ad05 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -591,12 +591,21 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable) dev = pInfo->dev; rval = ActivateDevice(dev); if (rval != Success) + { + xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", idev->identifier); goto unwind; + } /* Enable it if it's properly initialised and we're currently in the VT */ if (enable && dev->inited && dev->startup && xf86Screens[0]->vtSema) { EnableDevice(dev); + if (!dev->enabled) + { + xf86Msg(X_ERROR, "Couldn't init device \"%s\"\n", idev->identifier); + rval = BadMatch; + goto unwind; + } /* send enter/leave event, update sprite window */ CheckMotion(NULL, dev); }