Skip to content

Commit 981dadc

Browse files
authored
[libcxx] Map Windows ERROR_NETNAME_DELETED to no_such_file_or_directory (#162257)
This fixes spurious failures in std/input.output/filesystems/fs.op.funcs/fs.op.proximate/proximate.pass.cpp on Windows. As part of that test, libcxx tries to open a fake network path such as "//foo/a". Normally, this sets the error ERROR_BAD_NETPATH, which is mapped to no_such_file_or_directory. However occasionally, it can end up setting the error ERROR_NETNAME_DELETED instead. Map ERROR_NETNAME_DELETED to no_such_file_or_directory just like ERROR_BAD_NETPATH is mapped. This makes these cases be treated equally within the create_file_status function in src/filesystem/file_descriptor.h, causing the __weakly_canonical function in operations.cpp to keep iterating, rather than erroring out.
1 parent aed73d2 commit 981dadc

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libcxx/src/system_error.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,8 @@ std::optional<errc> __win_err_to_errc(int err) {
9595
return errc::no_lock_available;
9696
case ERROR_NEGATIVE_SEEK:
9797
return errc::invalid_argument;
98+
case ERROR_NETNAME_DELETED:
99+
return errc::no_such_file_or_directory;
98100
case ERROR_NOACCESS:
99101
return errc::permission_denied;
100102
case ERROR_NOT_ENOUGH_MEMORY:

0 commit comments

Comments
 (0)