Welcome! Log In Create A New Profile

Advanced

[nginx] Win32: replaced NGX_EXDEV with more appropriate error code.

Maxim Dounin
March 29, 2016 02:56AM
details: http://hg.nginx.org/nginx/rev/7cdf612fd58c
branches:
changeset: 6469:7cdf612fd58c
user: Maxim Dounin <mdounin@mdounin.ru>
date: Tue Mar 29 09:52:15 2016 +0300
description:
Win32: replaced NGX_EXDEV with more appropriate error code.

Correct error code for NGX_EXDEV on Windows is ERROR_NOT_SAME_DEVICE,
"The system cannot move the file to a different disk drive".

Previously used ERROR_WRONG_DISK is about wrong diskette in the drive and
is not appropriate.

There is no real difference though, as MoveFile() is able to copy files
between disk drives, and will fail with ERROR_ACCESS_DENIED when asked
to copy directories. The ERROR_NOT_SAME_DEVICE error is only used
by MoveFileEx() when called without the MOVEFILE_COPY_ALLOWED flag.

diffstat:

src/os/win32/ngx_errno.h | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)

diffs (16 lines):

diff --git a/src/os/win32/ngx_errno.h b/src/os/win32/ngx_errno.h
--- a/src/os/win32/ngx_errno.h
+++ b/src/os/win32/ngx_errno.h
@@ -33,11 +33,7 @@ typedef DWORD ngx_e
*/
#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
- */
-#define NGX_EXDEV ERROR_WRONG_DISK
+#define NGX_EXDEV ERROR_NOT_SAME_DEVICE
#define NGX_ENOTDIR ERROR_PATH_NOT_FOUND
#define NGX_EISDIR ERROR_CANNOT_MAKE
#define NGX_ENOSPC ERROR_DISK_FULL

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Win32: replaced NGX_EXDEV with more appropriate error code.

Maxim Dounin 186 March 29, 2016 02:56AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 166
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready