From 69c6cbfdf19c032f32cbf7d39e2136856ceea5b1 Mon Sep 17 00:00:00 2001 From: Derek Foreman Date: Tue, 25 Jul 2017 16:51:21 -0500 Subject: [PATCH] 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/ --- src/lib/elput/elput_logind.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib/elput/elput_logind.c b/src/lib/elput/elput_logind.c index 91eaffc..842de22 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) int ret; ret = fstat(fd, &st); + close(fd); if (ret < 0) return; if (!S_ISCHR(st.st_mode)) return; -- 2.7.4