[libcxx] Map Windows ERROR_NETNAME_DELETED to no_such_file_or_directory #162257
+2
−0
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.