mirror of
https://github.com/nginx/nginx.git
synced 2025-02-25 18:55:26 -06:00
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.
This commit is contained in:
@@ -25,6 +25,7 @@ typedef int ngx_err_t;
|
||||
#define NGX_EACCES EACCES
|
||||
#define NGX_EBUSY EBUSY
|
||||
#define NGX_EEXIST EEXIST
|
||||
#define NGX_EEXIST_FILE EEXIST
|
||||
#define NGX_EXDEV EXDEV
|
||||
#define NGX_ENOTDIR ENOTDIR
|
||||
#define NGX_EISDIR EISDIR
|
||||
|
||||
@@ -25,8 +25,14 @@ typedef DWORD ngx_err_t;
|
||||
#define NGX_ENOPATH ERROR_PATH_NOT_FOUND
|
||||
#define NGX_ENOMEM ERROR_NOT_ENOUGH_MEMORY
|
||||
#define NGX_EACCES ERROR_ACCESS_DENIED
|
||||
/* it's seems that ERROR_FILE_EXISTS is not appropriate error code */
|
||||
/*
|
||||
* there are two EEXIST error codes:
|
||||
* ERROR_FILE_EXISTS used by CreateFile(CREATE_NEW),
|
||||
* and ERROR_ALREADY_EXISTS used by CreateDirectory();
|
||||
* MoveFile() uses both
|
||||
*/
|
||||
#define NGX_EEXIST ERROR_ALREADY_EXISTS
|
||||
#define NGX_EEXIST_FILE ERROR_FILE_EXISTS
|
||||
/*
|
||||
* could not found cross volume directory move error code,
|
||||
* so use ERROR_WRONG_DISK as stub one
|
||||
|
||||
Reference in New Issue
Block a user