more sockets to close on fork()
authorRobin Gareus <robin@gareus.org>
Fri, 7 Jun 2013 15:12:25 +0000 (17:12 +0200)
committerRobin Gareus <robin@gareus.org>
Fri, 7 Jun 2013 15:12:25 +0000 (17:12 +0200)
libs/ardour/butler.cc
libs/ardour/rdff.c
libs/pbd/crossthread.cc

index db1b316368e7d1b0fc3f4cb5e6ba72a48cefc33f..119f01fc6b30a3005842f246c61a78433753b60e 100644 (file)
@@ -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;
index ca8e1abf1fd6d07a155ea957c2cca4123188e7b6..9dbb6ddae1e582229130a94f8515b0d0f6c02d0a 100644 (file)
@@ -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;
index 2ffede5163aecc736372818fd82ddb934b2d8d42..aa9d2edcd2e75a0a372ca6dc903bc92296f15973 100644 (file)
@@ -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 ()