summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2018-02-26 18:32:07 +0100
committerSven Eden <yamakuzure@gmx.net>2018-05-30 07:59:06 +0200
commit94f8dafc1c6c03d5ab3694941905578c3f39fc4c (patch)
treebad925964126791c76a1ff1a455017165dca3e04 /src
parentc70a304dfcc93d3360413dbb4c36884c33f5f201 (diff)
logind: rework sd_eviocrevoke()
Let's initialize static variables properly and get rid of redundant variables.
Diffstat (limited to 'src')
-rw-r--r--src/login/logind-session-device.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/login/logind-session-device.c b/src/login/logind-session-device.c
index cc56e62df..b74f31a37 100644
--- a/src/login/logind-session-device.c
+++ b/src/login/logind-session-device.c
@@ -111,17 +111,15 @@ static int session_device_notify(SessionDevice *sd, enum SessionDeviceNotificati
}
static int sd_eviocrevoke(int fd) {
- static bool warned;
- int r;
+ static bool warned = false;
assert(fd >= 0);
- r = ioctl(fd, EVIOCREVOKE, NULL);
- if (r < 0) {
- r = -errno;
- if (r == -EINVAL && !warned) {
+ if (ioctl(fd, EVIOCREVOKE, NULL) < 0) {
+
+ if (errno == EINVAL && !warned) {
+ log_warning_errno(errno, "Kernel does not support evdev-revocation: %m");
warned = true;
- log_warning("kernel does not support evdev-revocation");
}
}