}
file[i].fd = ngx_open_file(file[i].name.data,
- NGX_FILE_RDWR|NGX_FILE_APPEND,
+ NGX_FILE_APPEND,
NGX_FILE_CREATE_OR_OPEN,
NGX_FILE_DEFAULT_ACCESS);
file[i].pos = file[i].buffer;
}
- fd = ngx_open_file(file[i].name.data, NGX_FILE_RDWR|NGX_FILE_APPEND,
+ fd = ngx_open_file(file[i].name.data, NGX_FILE_APPEND,
NGX_FILE_CREATE_OR_OPEN, NGX_FILE_DEFAULT_ACCESS);
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
ngx_stderr_fileno = GetStdHandle(STD_ERROR_HANDLE);
ngx_stderr.fd = ngx_open_file((u_char *) NGX_ERROR_LOG_PATH,
- NGX_FILE_RDWR|NGX_FILE_APPEND,
+ NGX_FILE_APPEND,
NGX_FILE_CREATE_OR_OPEN,
NGX_FILE_DEFAULT_ACCESS);
fd = ngx_open_file(name, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0);
} else {
- fd = ngx_open_file(name, NGX_FILE_RDWR|NGX_FILE_APPEND,
- NGX_FILE_CREATE_OR_OPEN, NGX_FILE_DEFAULT_ACCESS);
+ fd = ngx_open_file(name, NGX_FILE_APPEND, NGX_FILE_CREATE_OR_OPEN,
+ NGX_FILE_DEFAULT_ACCESS);
}
if (fd == NGX_INVALID_FILE) {
#define NGX_FILE_CREATE_OR_OPEN O_CREAT
#define NGX_FILE_OPEN 0
#define NGX_FILE_TRUNCATE O_TRUNC
-#define NGX_FILE_APPEND O_APPEND
+#define NGX_FILE_APPEND O_WRONLY|O_APPEND
#define NGX_FILE_DEFAULT_ACCESS 0644
#define NGX_FILE_OWNER_ACCESS 0600