diff options
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/ngx_cycle.c | 10 | ||||
| -rw-r--r-- | src/core/ngx_log.c | 14 | ||||
| -rw-r--r-- | src/core/ngx_open_file_cache.c | 5 |
3 files changed, 11 insertions, 18 deletions
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c index f3dc8619b..b6e9af275 100644 --- a/src/core/ngx_cycle.c +++ b/src/core/ngx_cycle.c @@ -359,8 +359,9 @@ ngx_init_cycle(ngx_cycle_t *old_cycle) continue; } - file[i].fd = ngx_open_file(file[i].name.data, NGX_FILE_RDWR, - NGX_FILE_CREATE_OR_OPEN|NGX_FILE_APPEND, + file[i].fd = ngx_open_file(file[i].name.data, + NGX_FILE_RDWR|NGX_FILE_APPEND, + NGX_FILE_CREATE_OR_OPEN, NGX_FILE_DEFAULT_ACCESS); ngx_log_debug3(NGX_LOG_DEBUG_CORE, log, 0, @@ -1064,9 +1065,8 @@ ngx_reopen_files(ngx_cycle_t *cycle, ngx_uid_t user) file[i].pos = file[i].buffer; } - fd = ngx_open_file(file[i].name.data, NGX_FILE_RDWR, - NGX_FILE_CREATE_OR_OPEN|NGX_FILE_APPEND, - NGX_FILE_DEFAULT_ACCESS); + fd = ngx_open_file(file[i].name.data, NGX_FILE_RDWR|NGX_FILE_APPEND, + NGX_FILE_CREATE_OR_OPEN, NGX_FILE_DEFAULT_ACCESS); ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0, "reopen file \"%s\", old:%d new:%d", diff --git a/src/core/ngx_log.c b/src/core/ngx_log.c index f39f70f93..83cbbee0d 100644 --- a/src/core/ngx_log.c +++ b/src/core/ngx_log.c @@ -200,8 +200,10 @@ ngx_log_init(void) ngx_stderr_fileno = GetStdHandle(STD_ERROR_HANDLE); - ngx_stderr.fd = ngx_open_file(NGX_ERROR_LOG_PATH, NGX_FILE_RDWR, - NGX_FILE_CREATE_OR_OPEN|NGX_FILE_APPEND, 0); + ngx_stderr.fd = ngx_open_file((u_char *) NGX_ERROR_LOG_PATH, + NGX_FILE_RDWR|NGX_FILE_APPEND, + NGX_FILE_CREATE_OR_OPEN, + NGX_FILE_DEFAULT_ACCESS); if (ngx_stderr.fd == NGX_INVALID_FILE) { ngx_message_box("nginx", MB_OK, ngx_errno, @@ -210,14 +212,6 @@ ngx_log_init(void) return NULL; } - if (ngx_file_append_mode(ngx_stderr.fd) == NGX_ERROR) { - ngx_message_box("nginx", MB_OK, ngx_errno, - "Could not open error log file: " - ngx_file_append_mode_n " \"" NGX_ERROR_LOG_PATH - "\" failed"); - return NULL; - } - #else ngx_stderr.fd = STDERR_FILENO; diff --git a/src/core/ngx_open_file_cache.c b/src/core/ngx_open_file_cache.c index 60a8368be..2f6581bda 100644 --- a/src/core/ngx_open_file_cache.c +++ b/src/core/ngx_open_file_cache.c @@ -466,9 +466,8 @@ ngx_open_and_stat_file(u_char *name, ngx_open_file_info_t *of, ngx_log_t *log) fd = ngx_open_file(name, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0); } else { - fd = ngx_open_file(name, NGX_FILE_RDWR, - NGX_FILE_CREATE_OR_OPEN|NGX_FILE_APPEND, - NGX_FILE_DEFAULT_ACCESS); + fd = ngx_open_file(name, NGX_FILE_RDWR|NGX_FILE_APPEND, + NGX_FILE_CREATE_OR_OPEN, NGX_FILE_DEFAULT_ACCESS); } if (fd == NGX_INVALID_FILE) { |
