From: Peter Hutterer Date: Mon, 12 Aug 2024 03:49:54 +0000 (+1000) Subject: logind: if EVIOCREVOKE fails, don't try it again X-Git-Tag: v257-rc1~664^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1e922cc7ff016dd7ca56678bdc39453032fe79b9;p=thirdparty%2Fsystemd.git logind: if EVIOCREVOKE fails, don't try it again Let's assume that if the ioctl fails once with EINVAL, we won't have to try this again. --- diff --git a/src/login/logind-session-device.c b/src/login/logind-session-device.c index c924f1e0cad..1b3eb718f78 100644 --- a/src/login/logind-session-device.c +++ b/src/login/logind-session-device.c @@ -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; }