Mercurial > hg > nginx
diff src/core/ngx_cycle.c @ 227:2ba3477070ac
nginx-0.0.1-2004-01-14-21:19:42 import
author | Igor Sysoev <igor@sysoev.ru> |
---|---|
date | Wed, 14 Jan 2004 18:19:42 +0000 |
parents | 4f81b931e9ff |
children | 86e473b5641e |
line wrap: on
line diff
--- a/src/core/ngx_cycle.c Tue Jan 13 21:33:59 2004 +0000 +++ b/src/core/ngx_cycle.c Wed Jan 14 18:19:42 2004 +0000 @@ -138,8 +138,6 @@ 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 @@ 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 @@ 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) {