mirror of
https://github.com/systemd/systemd-stable.git
synced 2024-12-23 17:34:00 +03:00
logind: rework sd_eviocrevoke()
Let's initialize static variables properly and get rid of redundant variables.
This commit is contained in:
parent
864fe630a7
commit
5d5330a8e4
@ -107,17 +107,15 @@ static int session_device_notify(SessionDevice *sd, enum SessionDeviceNotificati
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int sd_eviocrevoke(int fd) {
|
static int sd_eviocrevoke(int fd) {
|
||||||
static bool warned;
|
static bool warned = false;
|
||||||
int r;
|
|
||||||
|
|
||||||
assert(fd >= 0);
|
assert(fd >= 0);
|
||||||
|
|
||||||
r = ioctl(fd, EVIOCREVOKE, NULL);
|
if (ioctl(fd, EVIOCREVOKE, NULL) < 0) {
|
||||||
if (r < 0) {
|
|
||||||
r = -errno;
|
if (errno == EINVAL && !warned) {
|
||||||
if (r == -EINVAL && !warned) {
|
log_warning_errno(errno, "Kernel does not support evdev-revocation: %m");
|
||||||
warned = true;
|
warned = true;
|
||||||
log_warning("kernel does not support evdev-revocation");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user