Skip to content
This repository has been archived by the owner on May 4, 2018. It is now read-only.

Commit

Permalink
win: map ERROR_PRIVILEGE_NOT_HELD to UV_EPERM
Browse files Browse the repository at this point in the history
  • Loading branch information
saghul authored and piscisaureus committed Jun 25, 2012
1 parent 0387c23 commit 431d61a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/win/error.c
Expand Up @@ -86,6 +86,7 @@ uv_err_code uv_translate_sys_error(int sys_errno) {
case ERROR_MOD_NOT_FOUND: return UV_ENOENT;
case ERROR_PATH_NOT_FOUND: return UV_ENOENT;
case ERROR_ACCESS_DENIED: return UV_EPERM;
case ERROR_PRIVILEGE_NOT_HELD: return UV_EPERM;
case ERROR_NOACCESS: return UV_EACCES;
case WSAEACCES: return UV_EACCES;
case ERROR_ADDRESS_ALREADY_ASSOCIATED: return UV_EADDRINUSE;
Expand Down
4 changes: 2 additions & 2 deletions test/test-fs.c
Expand Up @@ -1224,10 +1224,10 @@ TEST_IMPL(fs_symlink) {
* We just pass the test and bail out early if we get ENOTSUP.
*/
return 0;
} else if (uv_last_error(loop).sys_errno_ == ERROR_PRIVILEGE_NOT_HELD) {
} else if (uv_last_error(loop).code == UV_EPERM) {
/*
* Creating a symlink is only allowed when running elevated.
* We pass the test and bail out early if we get ERROR_PRIVILEGE_NOT_HELD.
* We pass the test and bail out early if we get UV_EPERM.
*/
return 0;
}
Expand Down

0 comments on commit 431d61a

Please sign in to comment.