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.
This commit is contained in:
Peter Hutterer
2024-08-12 14:45:25 +10:00
parent 1e2aa88bb2
commit 1e922cc7ff
+2 -3
View 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;
}