Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nginx/nginx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIgor Sysoev <igor@sysoev.ru>2009-03-31 17:52:01 +0400
committerIgor Sysoev <igor@sysoev.ru>2009-03-31 17:52:01 +0400
commit24c2787163e79a9d58e855109c15284a4e659483 (patch)
treecc48efc06765f3932f96eabc2f2f1f9896c7bb56 /src
parentfadc7a7e810874b95bb934aa107bfe0a795347d3 (diff)
Win32 appends synchronized if only FILE_APPEND_DATA and SYNCHRONIZE are set
without any other flags. On the other hand, Unix requires at least the write flag to be set together with O_APPEND.
Diffstat (limited to 'src')
-rw-r--r--src/core/ngx_cycle.c4
-rw-r--r--src/core/ngx_log.c2
-rw-r--r--src/core/ngx_open_file_cache.c4
-rw-r--r--src/os/unix/ngx_files.h2
4 files changed, 6 insertions, 6 deletions
diff --git a/src/core/ngx_cycle.c b/src/core/ngx_cycle.c
index b6e9af275..d566f850c 100644
--- a/src/core/ngx_cycle.c
+++ b/src/core/ngx_cycle.c
@@ -360,7 +360,7 @@ ngx_init_cycle(ngx_cycle_t *old_cycle)
}
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);
@@ -1065,7 +1065,7 @@ 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_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,
diff --git a/src/core/ngx_log.c b/src/core/ngx_log.c
index 83cbbee0d..f1718f185 100644
--- a/src/core/ngx_log.c
+++ b/src/core/ngx_log.c
@@ -201,7 +201,7 @@ ngx_log_init(void)
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);
diff --git a/src/core/ngx_open_file_cache.c b/src/core/ngx_open_file_cache.c
index 2f6581bda..cb7073675 100644
--- a/src/core/ngx_open_file_cache.c
+++ b/src/core/ngx_open_file_cache.c
@@ -466,8 +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_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) {
diff --git a/src/os/unix/ngx_files.h b/src/os/unix/ngx_files.h
index dcd14c35f..982ab12b3 100644
--- a/src/os/unix/ngx_files.h
+++ b/src/os/unix/ngx_files.h
@@ -64,7 +64,7 @@ typedef struct {
#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