diff options
author | Igor Sysoev <igor@sysoev.ru> | 2004-01-14 18:19:42 +0000 |
---|---|---|
committer | Igor Sysoev <igor@sysoev.ru> | 2004-01-14 18:19:42 +0000 |
commit | 0911f770834c3217e79da304c4d46d2606228bab (patch) | |
tree | dbda0b6c327919a44474fe869535cd969cb66fec /src/core/ngx_cycle.c | |
parent | 80340f0152ad5bb4c0a4fdf88873331e77eae5f5 (diff) | |
download | nginx-0911f770834c3217e79da304c4d46d2606228bab.tar.gz nginx-0911f770834c3217e79da304c4d46d2606228bab.zip |
nginx-0.0.1-2004-01-14-21:19:42 import
Diffstat (limited to 'src/core/ngx_cycle.c')
-rw-r--r-- | src/core/ngx_cycle.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c index debcca87f..12c053fa1 100644 --- a/src/core/ngx_cycle.c +++ b/src/core/ngx_cycle.c @@ -138,8 +138,6 @@ ngx_cycle_t *ngx_init_cycle(ngx_cycle_t *old_cycle) NGX_FILE_RDWR, NGX_FILE_CREATE_OR_OPEN|NGX_FILE_APPEND); -ngx_log_debug(log, "OPEN: %d:%s" _ file[i].fd _ file[i].name.data); - if (file[i].fd == NGX_INVALID_FILE) { ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, ngx_open_file_n " \"%s\" failed", @@ -156,6 +154,14 @@ ngx_log_debug(log, "OPEN: %d:%s" _ file[i].fd _ file[i].name.data); failed = 1; break; } +#else + if (fcntl(file[i].fd, F_SETFD, FD_CLOEXEC) == -1) { + ngx_log_error(NGX_LOG_EMERG, log, ngx_errno, + "fcntl(FD_CLOEXEC) \"%s\" failed", + file[i].name.data); + failed = 1; + break; + } #endif } @@ -631,6 +637,20 @@ void ngx_reopen_files(ngx_cycle_t *cycle) continue; } +#else + if (fcntl(fd, F_SETFD, FD_CLOEXEC) == -1) { + ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, + "fcntl(FD_CLOEXEC) \"%s\" failed", + file[i].name.data); + + if (ngx_close_file(fd) == NGX_FILE_ERROR) { + ngx_log_error(NGX_LOG_EMERG, cycle->log, ngx_errno, + ngx_close_file_n " \"%s\" failed", + file[i].name.data); + } + + continue; + } #endif if (ngx_close_file(file[i].fd) == NGX_FILE_ERROR) { |