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 <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Daniel Stone 2008-12-26 18:32:41 +11:00
parent 534669b376
commit d929ba6886

View File

@ -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);
}