Merge pull request #34055 from whot/wip/eviocrevoke-warnings

Update warnings for failed EVIOCREVOKE invocations
This commit is contained in:
Yu Watanabe
2024-08-22 01:34:35 +09:00
committed by GitHub
+5 -4
View File
@@ -95,11 +95,12 @@ static void sd_eviocrevoke(int fd) {
assert(fd >= 0);
if (ioctl(fd, EVIOCREVOKE, NULL) < 0) {
if (errno == EINVAL && !warned) {
log_warning_errno(errno, "Kernel does not support evdev-revocation: %m");
if (!warned && ioctl(fd, EVIOCREVOKE, NULL) < 0) {
if (errno == EINVAL) {
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");
}
}
}