diff options
author | Peter Hutterer <whot@possum.(none)> | 2008-07-14 13:06:32 +0930 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2008-07-14 13:17:39 +0930 |
commit | e926356eb0dfd218e88d47d8ed1e3ccfb2f1c85a (patch) | |
tree | 8429f7ebed3a30c4af34e100362d4abf39d08ed6 | |
parent | Add .gitignore file. (diff) | |
download | xf86-input-evdev-e926356eb0dfd218e88d47d8ed1e3ccfb2f1c85a.tar.gz xf86-input-evdev-e926356eb0dfd218e88d47d8ed1e3ccfb2f1c85a.tar.bz2 xf86-input-evdev-e926356eb0dfd218e88d47d8ed1e3ccfb2f1c85a.zip |
Don't enable the device if the grab failed with ENODEV.
After suspend/resume, sometimes the device doesn't come back up on the same
node. Since we do not call PreInit for the device (which would detect this
situation), we continue to try to read a nonexisting file, spamming the log
file with "Read Error".
(cherry picked from commit bf0d81011e19a8bb5bbd80c6b496c8ae257b4f2c)
-rw-r--r-- | src/evdev.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/evdev.c b/src/evdev.c index da6fa3b..471bb51 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -841,12 +841,15 @@ EvdevProc(DeviceIntPtr device, int what) if (!pEvdev->kernel24 && ioctl(pInfo->fd, EVIOCGRAB, (void *)1)) xf86Msg(X_WARNING, "%s: Grab failed (%s)\n", pInfo->name, strerror(errno)); - xf86AddEnabledDevice(pInfo); - if (pEvdev->flags & EVDEV_BUTTON_EVENTS) - EvdevMBEmuPreInit(pInfo); - device->public.on = TRUE; + if (errno != ENODEV) + { + xf86AddEnabledDevice(pInfo); + if (pEvdev->flags & EVDEV_BUTTON_EVENTS) + EvdevMBEmuPreInit(pInfo); + device->public.on = TRUE; + } break; - + case DEVICE_OFF: if (!pEvdev->kernel24 && ioctl(pInfo->fd, EVIOCGRAB, (void *)0)) xf86Msg(X_WARNING, "%s: Release failed (%s)\n", pInfo->name, |