]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
logind: if EVIOCREVOKE fails, don't try it again
authorPeter Hutterer <peter.hutterer@who-t.net>
Mon, 12 Aug 2024 03:49:54 +0000 (13:49 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Mon, 12 Aug 2024 04:45:25 +0000 (14:45 +1000)
Let's assume that if the ioctl fails once with EINVAL, we won't have to
try this again.

src/login/logind-session-device.c

index c924f1e0cad21303cf04ebabe7a12ac4f896bfe6..1b3eb718f782b7bc15ebb653285e654175587802 100644 (file)
@@ -95,9 +95,8 @@ static void sd_eviocrevoke(int fd) {
 
         assert(fd >= 0);
 
-        if (ioctl(fd, EVIOCREVOKE, NULL) < 0) {
-
-                if (errno == EINVAL && !warned) {
+        if (!warned && ioctl(fd, EVIOCREVOKE, NULL) < 0) {
+                if (errno == EINVAL) {
                         log_warning_errno(errno, "Kernel does not support evdev-revocation: %m");
                         warned = true;
                 }