From df99859ad2478700267a21f993eb421e555ae960 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Fri, 7 Jun 2013 17:12:25 +0200 Subject: [PATCH] more sockets to close on fork() --- libs/ardour/butler.cc | 3 +++ libs/ardour/rdff.c | 2 ++ libs/pbd/crossthread.cc | 2 ++ 3 files changed, 7 insertions(+) diff --git a/libs/ardour/butler.cc b/libs/ardour/butler.cc index db1b316368..119f01fc6b 100644 --- a/libs/ardour/butler.cc +++ b/libs/ardour/butler.cc @@ -110,6 +110,9 @@ Butler::start_thread() return -1; } + fcntl(request_pipe[0], F_SETFD, fcntl(request_pipe[0], F_GETFD) | FD_CLOEXEC); + fcntl(request_pipe[1], F_SETFD, fcntl(request_pipe[1], F_GETFD) | FD_CLOEXEC); + //pthread_detach (thread); return 0; diff --git a/libs/ardour/rdff.c b/libs/ardour/rdff.c index ca8e1abf1f..9dbb6ddae1 100644 --- a/libs/ardour/rdff.c +++ b/libs/ardour/rdff.c @@ -74,6 +74,8 @@ rdff_open(const char* path, bool write) } } + fcntl(fileno(fd), F_SETFD, fcntl(fileno(fd), F_GETFD) | FD_CLOEXEC); + RDFF ret = (RDFF)malloc(sizeof(struct _RDFF)); ret->fd = fd; ret->size = size; diff --git a/libs/pbd/crossthread.cc b/libs/pbd/crossthread.cc index 2ffede5163..aa9d2edcd2 100644 --- a/libs/pbd/crossthread.cc +++ b/libs/pbd/crossthread.cc @@ -52,6 +52,8 @@ CrossThreadChannel::CrossThreadChannel (bool non_blocking) return; } } + fcntl(fds[0], F_SETFD, fcntl(fds[0], F_GETFD) | FD_CLOEXEC); + fcntl(fds[1], F_SETFD, fcntl(fds[1], F_GETFD) | FD_CLOEXEC); } CrossThreadChannel::~CrossThreadChannel () -- 2.30.2