Makes sense, we already set the CLOEXEC flag in the sockets.

Given it's causing you issues, would you be able to test it and send a
PR to fix it? Thanks!

On Fri, 2016-12-02 at 14:19 +0100, zmqdev wrote:
> while investigating a problem involving fork() and zeromq, I found some 
> file descriptor leaks.
> 
> 
> 1. The function
> 
>       zmq::epoll_t::epoll_t (const zmq::ctx_t &ctx_)
> 
> in src/epoll.cpp creates an epoll instance with
> 
>       epoll_fd = epoll_create(1);
> 
> SUGGESTION: replace with
> 
>       epoll_fd = epoll_create1(EPOLL_CLOEXEC);
> 
> 
> 2. The function
> 
>       zmq::signaler_t::make_fdpair (fd_t *r_, fd_t *w_)
> 
> in src/signaler.cpp creates an eventfd object with
> 
> #if defined ZMQ_HAVE_EVENTFD
>       fd_t fd = eventfd (0, 0);
> 
> SUGGESTION: replace with
> 
> #if defined ZMQ_HAVE_EVENTFD
>       fd_t fd = eventfd (0, EFD_CLOEXEC);
> 
> 
> 
> _______________________________________________
> zeromq-dev mailing list
> [email protected]
> http://lists.zeromq.org/mailman/listinfo/zeromq-dev


Attachment: signature.asc
Description: This is a digitally signed message part

_______________________________________________
zeromq-dev mailing list
[email protected]
http://lists.zeromq.org/mailman/listinfo/zeromq-dev

Reply via email to