nghttpx: Set close-on-exec flag on listener in worker process

This commit is contained in:
Tatsuhiro Tsujikawa 2017-03-01 23:20:36 +09:00
parent 4989e6e419
commit c1f7795dd6
1 changed files with 6 additions and 0 deletions

View File

@ -1209,6 +1209,12 @@ pid_t fork_worker_process(int &main_ipc_fd,
if (pid == 0) {
ev_loop_fork(EV_DEFAULT);
auto config = get_config();
for (auto &addr : config->conn.listener.addrs) {
util::make_socket_closeonexec(addr.fd);
}
// Remove all WorkerProcesses to stop any registered watcher on
// default loop.
worker_process_remove_all();