13
0

more sockets to close on fork()

This commit is contained in:
Robin Gareus 2013-06-07 17:12:25 +02:00
parent 024e556cb2
commit df99859ad2
3 changed files with 7 additions and 0 deletions

View File

@ -110,6 +110,9 @@ Butler::start_thread()
return -1; 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); //pthread_detach (thread);
return 0; return 0;

View 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)); RDFF ret = (RDFF)malloc(sizeof(struct _RDFF));
ret->fd = fd; ret->fd = fd;
ret->size = size; ret->size = size;

View File

@ -52,6 +52,8 @@ CrossThreadChannel::CrossThreadChannel (bool non_blocking)
return; 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 () CrossThreadChannel::~CrossThreadChannel ()