summaryrefslogtreecommitdiff
path: root/src/login/logind-core.c
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2017-06-27 17:46:28 +0200
committerSven Eden <yamakuzure@gmx.net>2017-07-25 09:46:53 +0200
commit88bbc24cd275253fd495d7bc896adda644316bb5 (patch)
tree1f1c702a8407f43c1eaad42def0e346e8c2eeffa /src/login/logind-core.c
parent964a6d9fb555cc86528eb1cc1f6d044f85584842 (diff)
logind: filter out input devices that have none of the keys/switche we care about
Let's check what keys are there, before we actually hang on to the opened devices.
Diffstat (limited to 'src/login/logind-core.c')
-rw-r--r--src/login/logind-core.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/login/logind-core.c b/src/login/logind-core.c
index e505fcb0e..7e6b63f12 100644
--- a/src/login/logind-core.c
+++ b/src/login/logind-core.c
@@ -269,7 +269,11 @@ int manager_process_button_device(Manager *m, struct udev_device *d) {
sn = "seat0";
button_set_seat(b, sn);
- button_open(b);
+
+ r = button_open(b);
+ if (r < 0) /* event device doesn't have any keys or switches relevant to us? (or any other error
+ * opening the device?) let's close the button again. */
+ button_free(b);
}
return 0;