]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
logind: warn about EVIOCREVOKE errors other than EINVAL too 34055/head
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 12 Aug 2024 04:05:13 +0000 (14:05 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Wed, 21 Aug 2024 06:33:22 +0000 (16:33 +1000)
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.

src/login/logind-session-device.c

index 1b3eb718f782b7bc15ebb653285e654175587802..2aff0b7c8c3edca479c49945c4b1640714819722 100644 (file)
@@ -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");
                 }
         }
 }