diff options
-rw-r--r-- | src/evdev.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/evdev.c b/src/evdev.c index e212c14..13f03d3 100644 --- a/src/evdev.c +++ b/src/evdev.c @@ -901,9 +901,14 @@ EvdevProbe(InputInfoPtr pInfo) int i, has_axes, has_buttons, has_keys; EvdevPtr pEvdev = pInfo->private; - if (ioctl(pInfo->fd, EVIOCGRAB, (void *)1) && errno == EINVAL) { - /* keyboards are unsafe in 2.4 */ - pEvdev->kernel24 = 1; + if (ioctl(pInfo->fd, EVIOCGRAB, (void *)1)) { + if (errno == EINVAL) { + /* keyboards are unsafe in 2.4 */ + pEvdev->kernel24 = 1; + } else { + xf86Msg(X_ERROR, "Grab failed. Device already configured?\n"); + return 1; + } } else { ioctl(pInfo->fd, EVIOCGRAB, (void *)0); } |