[PATCH weston 2/2] input: Set CLOEXEC on all opened fds

Derek Foreman derekf at osg.samsung.com
Thu Apr 30 09:20:58 PDT 2015


We'd rather not have these fds available in all child processes, even
if using old versions of libinput that don't bother to set CLOEXEC

Signed-off-by: Derek Foreman <derekf at osg.samsung.com>
---
 src/libinput-seat.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/libinput-seat.c b/src/libinput-seat.c
index c0a87ea..6eae1a4 100644
--- a/src/libinput-seat.c
+++ b/src/libinput-seat.c
@@ -186,7 +186,7 @@ open_restricted(const char *path, int flags, void *user_data)
 	struct udev_input *input = user_data;
 	struct weston_launcher *launcher = input->compositor->launcher;
 
-	return weston_launcher_open(launcher, path, flags);
+	return weston_launcher_open(launcher, path, flags | O_CLOEXEC);
 }
 
 static void
-- 
2.1.4



More information about the wayland-devel mailing list