[PATCH libinput] evdev: fail before open_restricted if the devnode doesn't exist

Jeffrey Smith whydoubt at gmail.com
Fri Feb 9 18:00:47 UTC 2018

> +       if (!devnode) {
> +               log_info(libinput, "%s: no device node associated\n", sysname);
> +               return NULL;
> +       }
> +
>         if (udev_device_should_be_ignored(udev_device)) {
>                 log_debug(libinput, "%s: device is ignored\n", sysname);
>                 return NULL;

As long as you are intentionally wanting this reported even if the
device "should be ignored", then it LGTM.

> +       if (devnode == NULL)
> +               return -ENODEV;
> +

Checking (!devnode) would be better as it matches the other change,
and in evdev.c implicit NULL comparison is much more common than
explicit NULL comparison.

AFAICT, the return value from evdev_device_resume is never checked, so
it seems that this may be a good place for a log message too.  Would
it be noisy?  If so, maybe a log_debug would be enough.

 -- Jeff

More information about the wayland-devel mailing list