From 668fc0de0b57d0bc635ef63ad2d5ba0c03d7932d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Wed, 4 Sep 2013 20:48:46 -0700 Subject: [PATCH] xwm: Fix fd leak in selection code The file descriptors we receive in the wayland protocol callbacks are already O_CLOEXEC, so don't dup them to set O_CLOEXEC.` --- src/xwayland/selection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/xwayland/selection.c b/src/xwayland/selection.c index 735b726d..d220569e 100644 --- a/src/xwayland/selection.c +++ b/src/xwayland/selection.c @@ -135,7 +135,7 @@ data_source_send(struct weston_data_source *base, xcb_flush(wm->conn); fcntl(fd, F_SETFL, O_WRONLY | O_NONBLOCK); - wm->data_source_fd = fcntl(fd, F_DUPFD_CLOEXEC, fd); + wm->data_source_fd = fd; } }