From e0207bb8eb230d4750c4f328af9afbb79051a026 Mon Sep 17 00:00:00 2001 From: Igor Sysoev Date: Wed, 23 Jun 2004 15:18:17 +0000 Subject: nginx-0.0.7-2004-06-23-19:18:17 import --- src/os/unix/ngx_process.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/os/unix/ngx_process.c') diff --git a/src/os/unix/ngx_process.c b/src/os/unix/ngx_process.c index 799eabee3..d6e2d390d 100644 --- a/src/os/unix/ngx_process.c +++ b/src/os/unix/ngx_process.c @@ -65,6 +65,22 @@ ngx_pid_t ngx_spawn_process(ngx_cycle_t *cycle, return NGX_ERROR; } + if (fcntl(ngx_processes[s].channel[0], F_SETFD, FD_CLOEXEC) == -1) { + ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, + "fcntl(FD_CLOEXEC) failed while spawning \"%s\"", + name); + ngx_close_channel(ngx_processes[s].channel, cycle->log); + return NGX_ERROR; + } + + if (fcntl(ngx_processes[s].channel[1], F_SETFD, FD_CLOEXEC) == -1) { + ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, + "fcntl(FD_CLOEXEC) failed while spawning \"%s\"", + name); + ngx_close_channel(ngx_processes[s].channel, cycle->log); + return NGX_ERROR; + } + ngx_channel = ngx_processes[s].channel[1]; } else { -- cgit v1.2.3