aboutsummaryrefslogtreecommitdiff
path: root/libcxx/src/filesystem/operations.cpp
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2020-11-09 11:48:21 +0200
committerMartin Storsjö <martin@martin.st>2021-05-25 23:48:50 +0300
commit68e45962531a25a0fab63eab163a6c9f84c81f1e (patch)
tree4369fc5f076e0dae5f33855207a118876b0c6a2d /libcxx/src/filesystem/operations.cpp
parenta004da0d77c4e0a8a17b4f84818d809b54b2079e (diff)
downloadllvm-68e45962531a25a0fab63eab163a6c9f84c81f1e.zip
llvm-68e45962531a25a0fab63eab163a6c9f84c81f1e.tar.gz
llvm-68e45962531a25a0fab63eab163a6c9f84c81f1e.tar.bz2
[libcxx] Fix the function name in exceptions from create_directories
If the nested create_directory call fails, we'd still want to re-report the errors with the create_directories function name, which is what the caller called. This fixes one aspect from MS STL's tests for std::filesystem. Differential Revision: https://reviews.llvm.org/D102365
Diffstat (limited to 'libcxx/src/filesystem/operations.cpp')
-rw-r--r--libcxx/src/filesystem/operations.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/libcxx/src/filesystem/operations.cpp b/libcxx/src/filesystem/operations.cpp
index 99001a0..5179eea 100644
--- a/libcxx/src/filesystem/operations.cpp
+++ b/libcxx/src/filesystem/operations.cpp
@@ -1022,7 +1022,10 @@ bool __create_directories(const path& p, error_code* ec) {
} else if (not is_directory(parent_st))
return err.report(errc::not_a_directory);
}
- return __create_directory(p, ec);
+ bool ret = __create_directory(p, &m_ec);
+ if (m_ec)
+ return err.report(m_ec);
+ return ret;
}
bool __create_directory(const path& p, error_code* ec) {