diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2016-03-29 09:51:46 +0300 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2016-03-29 09:51:46 +0300 |
commit | 6871615528044ff3dce2bf2abdf862d1178a2c9e (patch) | |
tree | ddc22c3ff087e2ad0b717c16575c243abd609397 /src/core/ngx_file.c | |
parent | 4618c03f4c130d30128a1cea135e2c9e636a13ba (diff) | |
download | nginx-6871615528044ff3dce2bf2abdf862d1178a2c9e.tar.gz nginx-6871615528044ff3dce2bf2abdf862d1178a2c9e.zip |
Win32: additional error code NGX_EEXIST_FILE (ticket #910).
On Windows there are two possible error codes which correspond to
the EEXIST error code: ERROR_FILE_EXISTS used by CreateFile(CREATE_NEW),
and ERROR_ALREADY_EXISTS used by CreateDirectory().
MoveFile() seems to use both: ERROR_ALREADY_EXISTS when moving within
one filesystem, and ERROR_FILE_EXISTS when copying a file to a different
drive.
Diffstat (limited to 'src/core/ngx_file.c')
-rw-r--r-- | src/core/ngx_file.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/core/ngx_file.c b/src/core/ngx_file.c index 2dc222865..d3e2ecebf 100644 --- a/src/core/ngx_file.c +++ b/src/core/ngx_file.c @@ -196,7 +196,7 @@ ngx_create_temp_file(ngx_file_t *file, ngx_path_t *path, ngx_pool_t *pool, err = ngx_errno; - if (err == NGX_EEXIST) { + if (err == NGX_EEXIST_FILE) { n = (uint32_t) ngx_next_temp_number(1); continue; } @@ -692,7 +692,7 @@ ngx_ext_rename_file(ngx_str_t *src, ngx_str_t *to, ngx_ext_rename_file_t *ext) #if (NGX_WIN32) - if (err == NGX_EEXIST) { + if (err == NGX_EEXIST || err == NGX_EEXIST_FILE) { err = ngx_win32_rename_file(src, to, ext->log); if (err == 0) { |