]> gcc.gnu.org Git - gcc.git/commit
libstdc++: Fix create_directories to resolve symlinks [PR101510]
authorJonathan Wakely <jwakely@redhat.com>
Tue, 20 Jul 2021 17:15:48 +0000 (18:15 +0100)
committerJonathan Wakely <jwakely@redhat.com>
Wed, 11 Aug 2021 14:30:38 +0000 (15:30 +0100)
commitbde28c60c70079416dd2181f882c0694e019eaef
treef93baa2c36ffdb301c122c09526809b97db15d69
parentc5f17274aabe61bb0193b8b68283c1f1da5ee699
libstdc++: Fix create_directories to resolve symlinks [PR101510]

When filesystem__create_directories checks to see if the path already
exists and resolves 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:
Check symlink to existing directory.
* testsuite/27_io/filesystem/operations/create_directory.cc: Do
not test with symlinks on Windows.
* testsuite/experimental/filesystem/operations/create_directories.cc:
Check symlink to existing directory.
* testsuite/experimental/filesystem/operations/create_directory.cc:
Do not test with symlinks on Windows.

(cherry picked from commit 124eaa50e0a34f5f89572c1aa812c50979da58fc)
libstdc++-v3/src/c++17/fs_ops.cc
libstdc++-v3/src/filesystem/ops.cc
libstdc++-v3/testsuite/27_io/filesystem/operations/create_directories.cc
libstdc++-v3/testsuite/27_io/filesystem/operations/create_directory.cc
libstdc++-v3/testsuite/experimental/filesystem/operations/create_directories.cc
libstdc++-v3/testsuite/experimental/filesystem/operations/create_directory.cc
This page took 0.066792 seconds and 6 git commands to generate.