summaryrefslogtreecommitdiff
path: root/src/lib/elput
diff options
context:
space:
mode:
authorDerek Foreman <derekf@osg.samsung.com>2017-07-25 16:51:21 -0500
committerDerek Foreman <derekf@osg.samsung.com>2017-07-25 16:59:11 -0500
commit69c6cbfdf19c032f32cbf7d39e2136856ceea5b1 (patch)
tree8d3c88adbcc32ddf0af2dc759a86dbed05ba895c /src/lib/elput
parenta5fc50c186b38aa3e0e8d37586201000a51eebfa (diff)
elput: Close fds when asked to
Our close callback tells logind we're done with a device, but it should also actually close the fd it's passed, or we end up leaking piles of fds on VC switch. see weston commit 8f5acc2f3a29c3831af4ddd6bed57f703c98dc77 and subsequent regression in commit 72dea06d7952e3ce8dd8057f7106186da4fa2678 and pending fix in https://patchwork.freedesktop.org/patch/168992/
Diffstat (limited to 'src/lib/elput')
-rw-r--r--src/lib/elput/elput_logind.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/elput/elput_logind.c b/src/lib/elput/elput_logind.c
index 91eaffcbda..842de225e8 100644
--- a/src/lib/elput/elput_logind.c
+++ b/src/lib/elput/elput_logind.c
@@ -649,6 +649,7 @@ _logind_close(Elput_Manager *em, int fd)
649 int ret; 649 int ret;
650 650
651 ret = fstat(fd, &st); 651 ret = fstat(fd, &st);
652 close(fd);
652 if (ret < 0) return; 653 if (ret < 0) return;
653 654
654 if (!S_ISCHR(st.st_mode)) return; 655 if (!S_ISCHR(st.st_mode)) return;