When running against a kernel without properties, continue as usual
authorPeter Hutterer <peter.hutterer@who-t.net>
Tue, 8 Oct 2013 03:09:50 +0000 (13:09 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Tue, 22 Oct 2013 23:04:41 +0000 (09:04 +1000)
Missing out on properties is not fatal.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
libevdev/libevdev.c

index fd3c010..29640f4 100644 (file)
@@ -267,8 +267,12 @@ libevdev_set_fd(struct libevdev* dev, int fd)
        if (rc < 0)
                goto out;
 
+       /* Built on a kernel with props, running against a kernel without property
+          support. This should not be a fatal case, we'll be missing properties but other
+          than that everything is as expected.
+        */
        rc = ioctl(fd, EVIOCGPROP(sizeof(dev->props)), dev->props);
-       if (rc < 0)
+       if (rc < 0 && errno != EINVAL)
                goto out;
 
        rc = ioctl(fd, EVIOCGBIT(EV_REL, sizeof(dev->rel_bits)), dev->rel_bits);