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
13 years ago
359 | 359 |
}
|
360 | 360 |
|
361 | 361 |
file[i].fd = ngx_open_file(file[i].name.data,
|
362 | |
NGX_FILE_RDWR|NGX_FILE_APPEND,
|
|
362 |
NGX_FILE_APPEND,
|
363 | 363 |
NGX_FILE_CREATE_OR_OPEN,
|
364 | 364 |
NGX_FILE_DEFAULT_ACCESS);
|
365 | 365 |
|
|
1064 | 1064 |
file[i].pos = file[i].buffer;
|
1065 | 1065 |
}
|
1066 | 1066 |
|
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,
|
1068 | 1068 |
NGX_FILE_CREATE_OR_OPEN, NGX_FILE_DEFAULT_ACCESS);
|
1069 | 1069 |
|
1070 | 1070 |
ngx_log_debug3(NGX_LOG_DEBUG_EVENT, cycle->log, 0,
|
200 | 200 |
ngx_stderr_fileno = GetStdHandle(STD_ERROR_HANDLE);
|
201 | 201 |
|
202 | 202 |
ngx_stderr.fd = ngx_open_file((u_char *) NGX_ERROR_LOG_PATH,
|
203 | |
NGX_FILE_RDWR|NGX_FILE_APPEND,
|
|
203 |
NGX_FILE_APPEND,
|
204 | 204 |
NGX_FILE_CREATE_OR_OPEN,
|
205 | 205 |
NGX_FILE_DEFAULT_ACCESS);
|
206 | 206 |
|
465 | 465 |
fd = ngx_open_file(name, NGX_FILE_RDONLY, NGX_FILE_OPEN, 0);
|
466 | 466 |
|
467 | 467 |
} 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);
|
470 | 470 |
}
|
471 | 471 |
|
472 | 472 |
if (fd == NGX_INVALID_FILE) {
|
63 | 63 |
#define NGX_FILE_CREATE_OR_OPEN O_CREAT
|
64 | 64 |
#define NGX_FILE_OPEN 0
|
65 | 65 |
#define NGX_FILE_TRUNCATE O_TRUNC
|
66 | |
#define NGX_FILE_APPEND O_APPEND
|
|
66 |
#define NGX_FILE_APPEND O_WRONLY|O_APPEND
|
67 | 67 |
|
68 | 68 |
#define NGX_FILE_DEFAULT_ACCESS 0644
|
69 | 69 |
#define NGX_FILE_OWNER_ACCESS 0600
|