Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ad9a290

Browse filesBrowse files
richardlauabmusse
authored andcommitted
src: workaround AIX libc++ std::filesystem bug
On AIX libc++ is returning `EEXIST` instead of `EACCES` when using `std::filesystem::remove_all()` without appropriate permissions to recursively remove the directory. Co-authored-by: Abdirahim Musse <abdirahim.musse@ibm.com> Signed-off-by: Richard Lau <richard.lau@ibm.com> PR-URL: #62788 Refs: #62790 Reviewed-By: Abdirahim Musse <abdirahim.musse@ibm.com> Reviewed-By: Stewart X Addison <sxa@redhat.com>
1 parent 7597d20 commit ad9a290
Copy full SHA for ad9a290

1 file changed

+8Lines changed: 8 additions & 0 deletions

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎src/node_file.cc‎

Copy file name to clipboardExpand all lines: src/node_file.cc
+8Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1737,7 +1737,15 @@ static void RmSync(const FunctionCallbackInfo<Value>& args) {
17371737
} else if (error == std::errc::not_a_directory) {
17381738
std::string message = "Not a directory: " + file_path_str;
17391739
return env->ThrowErrnoException(ENOTDIR, "rm", message.c_str(), path_c_str);
1740+
#ifdef _AIX
1741+
} else if (error == std::errc::permission_denied ||
1742+
error == std::errc::file_exists) {
1743+
// Workaround for clang libc++ bug on AIX: std::filesystem::remove_all()
1744+
// incorrectly returns EEXIST (17) instead of EACCES (13) for permission
1745+
// errors when trying to remove directories without proper permissions.
1746+
#else
17401747
} else if (error == std::errc::permission_denied) {
1748+
#endif
17411749
std::string message = "Permission denied: " + file_path_str;
17421750
return env->ThrowErrnoException(
17431751
permission_denied_error, "rm", message.c_str(), path_c_str);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.