From 2e7d6d2203f5da0ce8e3c373d441b8bd43b1e064 Mon Sep 17 00:00:00 2001 From: Darshan Sen Date: Sun, 20 Mar 2022 15:36:14 +0530 Subject: [PATCH] Revert "win,errors: remap ERROR_ACCESS_DENIED to UV_EACCES (#3193)" (#3565) Although the change remapped the error code to the correct one, a lot of code already depends on the incorrect one, so it's not worth the breakage. This reverts commit 04a35efe69001a27e177aebde6c8db6f4cca7e4b. Refs: https://github.com/nodejs/node/pull/42340 Signed-off-by: Darshan Sen --- src/win/error.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/win/error.c b/src/win/error.c index 20ac19ef6e0..3a269da87a9 100644 --- a/src/win/error.c +++ b/src/win/error.c @@ -73,7 +73,6 @@ int uv_translate_sys_error(int sys_errno) { case WSAEACCES: return UV_EACCES; case ERROR_ELEVATION_REQUIRED: return UV_EACCES; case ERROR_CANT_ACCESS_FILE: return UV_EACCES; - case ERROR_ACCESS_DENIED: return UV_EACCES; case ERROR_ADDRESS_ALREADY_ASSOCIATED: return UV_EADDRINUSE; case WSAEADDRINUSE: return UV_EADDRINUSE; case WSAEADDRNOTAVAIL: return UV_EADDRNOTAVAIL; @@ -155,6 +154,7 @@ int uv_translate_sys_error(int sys_errno) { case WSAENOTSOCK: return UV_ENOTSOCK; case ERROR_NOT_SUPPORTED: return UV_ENOTSUP; case ERROR_BROKEN_PIPE: return UV_EOF; + case ERROR_ACCESS_DENIED: return UV_EPERM; case ERROR_PRIVILEGE_NOT_HELD: return UV_EPERM; case ERROR_BAD_PIPE: return UV_EPIPE; case ERROR_NO_DATA: return UV_EPIPE;