aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/src/filesystem/ops.cc
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2021-07-20 18:15:48 +0100
committerJonathan Wakely <jwakely@redhat.com>2021-07-20 20:34:47 +0100
commit124eaa50e0a34f5f89572c1aa812c50979da58fc (patch)
tree83477330e7dcdfb005f08c179036658a82edf3c1 /libstdc++-v3/src/filesystem/ops.cc
parente07d30fdcaec4906e0dcb948fc4748bf74c15c05 (diff)
downloadgcc-124eaa50e0a34f5f89572c1aa812c50979da58fc.zip
gcc-124eaa50e0a34f5f89572c1aa812c50979da58fc.tar.gz
gcc-124eaa50e0a34f5f89572c1aa812c50979da58fc.tar.bz2
libstdc++: Fix create_directories to resolve symlinks [PR101510]
When filesystem__create_directories checks to see if the path already exists and resovles to a directory, it uses filesystem::symlink_status, which means it reports an error if the path is a symlink. It should use filesystem::status, so that the target directory is detected, and no error is reported. Signed-off-by: Jonathan Wakely <jwakely@redhat.com> libstdc++-v3/ChangeLog: PR libstdc++/101510 * src/c++17/fs_ops.cc (fs::create_directories): Use status instead of symlink_status. * src/filesystem/ops.cc (fs::create_directories): Likewise. * testsuite/27_io/filesystem/operations/create_directories.cc: * testsuite/27_io/filesystem/operations/create_directory.cc: Do not test with symlinks on Windows. * testsuite/experimental/filesystem/operations/create_directories.cc: * testsuite/experimental/filesystem/operations/create_directory.cc: Do not test with symlinks on Windows.
Diffstat (limited to 'libstdc++-v3/src/filesystem/ops.cc')
-rw-r--r--libstdc++-v3/src/filesystem/ops.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/libstdc++-v3/src/filesystem/ops.cc b/libstdc++-v3/src/filesystem/ops.cc
index c400376..7c5b164 100644
--- a/libstdc++-v3/src/filesystem/ops.cc
+++ b/libstdc++-v3/src/filesystem/ops.cc
@@ -426,7 +426,7 @@ fs::create_directories(const path& p, error_code& ec) noexcept
return false;
}
- file_status st = symlink_status(p, ec);
+ file_status st = status(p, ec);
if (is_directory(st))
return false;
else if (ec && !status_known(st))