path: root/config
diff options
authorPeter Hutterer <>2014-05-02 14:14:58 +1000
committerPeter Hutterer <>2014-05-05 07:26:33 +1000
commit15460eaed28b5353a94a17091d7795cfaeda9146 (patch)
treeec55de12d947ac58db54b761f5dfa4b82a00cdc3 /config
parenta6f5ffd5879e7fb052d343592951cc476b699bb4 (diff)
systemd-logind: let the logind code decided whether to close an fd
We can only request one fd per device from systemd-logind. If a fd is re-used by the same device, releasing the fd from one device doesn't mean we can close it. The systemd code knows when it's really released, so let it close the fd. Test case: xorg.conf section for an input device with hotplugging enabled. evdev detects the duplicate and closes the hotplugged device, which closes the fd. The other instance of evdev thinks the fd is still valid so now you're playing a double lottery. First, which client(s) will get the evdev fd? Second, which requests will be picked up by evdev and which ones will be picked up by the client? You'll never know, but the fun is in finding out. Signed-off-by: Peter Hutterer <> Reviewed-by: Hans de Goede <>
Diffstat (limited to 'config')
1 files changed, 2 insertions, 4 deletions
diff --git a/config/config.c b/config/config.c
index def7f16ca..551451623 100644
--- a/config/config.c
+++ b/config/config.c
@@ -250,8 +250,6 @@ config_odev_free_attributes(struct OdevAttributes *attribs)
- if (fd != -1) {
- systemd_logind_release_fd(major, minor);
- close(fd);
- }
+ if (fd != -1)
+ systemd_logind_release_fd(major, minor, fd);