evdev: restore EVDEV_UNHANDLED_DEVICE error code
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 10 Feb 2014 05:40:49 +0000 (15:40 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 10 Feb 2014 05:40:49 +0000 (15:40 +1000)
If we don't have capabilities we can deal with, return a different
error so the backends can handle it separately (they already do).

Signe-off-by: Peter Hutterer <peter.hutterer@who-t.net>
src/evdev.c

index 9c6d116..d8dff65 100644 (file)
@@ -606,6 +606,7 @@ evdev_device_create(struct libinput_seat *seat,
        struct evdev_device *device;
        char devname[256] = "unknown";
        int fd;
+       int unhandled_device = 0;
 
        /* Use non-blocking mode so that we can loop on read on
         * evdev_device_data() until all events on the fd are
@@ -645,6 +646,7 @@ evdev_device_create(struct libinput_seat *seat,
                goto err;
 
        if (device->seat_caps == 0) {
+               unhandled_device = 1;
                goto err;
        }
 
@@ -668,7 +670,8 @@ err:
        if (fd >= 0)
                close_restricted(libinput, fd);
        evdev_device_destroy(device);
-       return NULL;
+
+       return unhandled_device ? EVDEV_UNHANDLED_DEVICE :  NULL;
 }
 
 int