All file descriptors should be opened with the CLOEXEC flag

Description

TCP and Unix sockets are opened with the CLOEXEC flag through zmq::open_socket in ip.cpp.
However some other file descriptors are not opened with the close-on-exec flag and so they will not be closed in case of a fork+exec. This may be a problem for processes which fork themselves, for instance a frontend process which forks worker processes to handle requests.
Examples of such file descriptors are fds created by eventfd in signaler.cpp, fds created by epoll_create in epoll.cpp, and fds created for /dev/poll in devpoll.cpp.

A patch is attached.

Environment

Linux

Assignee

Unassigned

Reporter

Rene-Pierre Lehmann

Labels

None

Components

Affects versions

Priority

Major
Configure