From: Peter Hutterer Date: Mon, 12 Aug 2024 04:05:13 +0000 (+1000) Subject: logind: warn about EVIOCREVOKE errors other than EINVAL too X-Git-Tag: v257-rc1~664^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4fc6bd9e7d4c99d3e61c985caae218d74e71f454;p=thirdparty%2Fsystemd.git logind: warn about EVIOCREVOKE errors other than EINVAL too 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. --- diff --git a/src/login/logind-session-device.c b/src/login/logind-session-device.c index 1b3eb718f78..2aff0b7c8c3 100644 --- a/src/login/logind-session-device.c +++ b/src/login/logind-session-device.c @@ -97,8 +97,10 @@ static void sd_eviocrevoke(int fd) { 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"); } } }