Klaus Demo nginx / 24c2787
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. Igor Sysoev 10 years ago
4 changed file(s) with 6 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
359359 }
360360
361361 file[i].fd = ngx_open_file(file[i].name.data,
362 NGX_FILE_RDWR|NGX_FILE_APPEND,
362 NGX_FILE_APPEND,
363363 NGX_FILE_CREATE_OR_OPEN,
364364 NGX_FILE_DEFAULT_ACCESS);
365365
10641064 file[i].pos = file[i].buffer;
10651065 }
10661066
1067 fd = ngx_open_file(file[i].name.data, NGX_FILE_RDWR|NGX_FILE_APPEND,
1067 fd = ngx_open_file(file[i].name.data, NGX_FILE_APPEND,
10681068 NGX_FILE_CREATE_OR_OPEN, NGX_FILE_DEFAULT_ACCESS);
10691069
10701070 ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
200200 ngx_stderr_fileno = GetStdHandle(STD_ERROR_HANDLE);
201201
202202 ngx_stderr.fd = ngx_open_file((u_char *) NGX_ERROR_LOG_PATH,
203 NGX_FILE_RDWR|NGX_FILE_APPEND,
203 NGX_FILE_APPEND,
204204 NGX_FILE_CREATE_OR_OPEN,
205205 NGX_FILE_DEFAULT_ACCESS);
206206
465465 fd = ngx_open_file(name, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0);
466466
467467 } else {
468 fd = ngx_open_file(name, NGX_FILE_RDWR|NGX_FILE_APPEND,
469 NGX_FILE_CREATE_OR_OPEN, NGX_FILE_DEFAULT_ACCESS);
468 fd = ngx_open_file(name, NGX_FILE_APPEND, NGX_FILE_CREATE_OR_OPEN,
469 NGX_FILE_DEFAULT_ACCESS);
470470 }
471471
472472 if (fd == NGX_INVALID_FILE) {
6363 #define NGX_FILE_CREATE_OR_OPEN O_CREAT
6464 #define NGX_FILE_OPEN 0
6565 #define NGX_FILE_TRUNCATE O_TRUNC
66 #define NGX_FILE_APPEND O_APPEND
66 #define NGX_FILE_APPEND O_WRONLY|O_APPEND
6767
6868 #define NGX_FILE_DEFAULT_ACCESS 0644
6969 #define NGX_FILE_OWNER_ACCESS 0600