EINVAL means the kernel doesn't support it, ENODEV means it's
already revoked or the device is no longer there which has the same
effect anyway. All others - let's print an error to the logs.
if (!warned && ioctl(fd, EVIOCREVOKE, NULL) < 0) {
if (errno == EINVAL) {
- log_warning_errno(errno, "Kernel does not support evdev-revocation: %m");
+ log_warning_errno(errno, "Kernel does not support evdev-revocation, continuing without revoking device access: %m");
warned = true;
+ } else if (errno != ENODEV) {
+ log_warning_errno(errno, "Failed to revoke evdev device, continuing without revoking device access: %m");
}
}
}