From f45b1e828409a517877fae9001fdfdb408a02b3d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kristian=20H=C3=B8gsberg?= Date: Wed, 18 Sep 2013 11:00:56 -0700 Subject: [PATCH] weston-launch: Pass the right CLOEXEC flag to fcntl Passing O_CLOEXEC to fcntl is wrong, we need to pass FD_CLOEXEC. --- src/weston-launch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/weston-launch.c b/src/weston-launch.c index be77a345..fa9104d3 100644 --- a/src/weston-launch.c +++ b/src/weston-launch.c @@ -195,7 +195,8 @@ setup_launcher_socket(struct weston_launch *wl) if (socketpair(AF_LOCAL, SOCK_DGRAM, 0, wl->sock) < 0) error(1, errno, "socketpair failed"); - fcntl(wl->sock[0], F_SETFD, O_CLOEXEC); + if (fcntl(wl->sock[0], F_SETFD, FD_CLOEXEC) < 0) + error(1, errno, "fcntl failed"); return 0; }