diff options
author | Jonathan Wakely <jwakely@redhat.com> | 2022-06-27 14:43:54 +0100 |
---|---|---|
committer | Jonathan Wakely <jwakely@redhat.com> | 2022-08-03 14:38:30 +0100 |
commit | 3df2f035871e913b94a35d4b5c12d37828f313f7 (patch) | |
tree | 17d977d836e31654dffb4fc686b0f337e807b802 /libgcc | |
parent | 1a9681e60964c7f7ce0892e14745e6dcf6100157 (diff) |
libstdc++: Improve directory iterator abstractions for openatlinaro-local/ci/tcwg_bmk_llvm_tk1/llvm-release-arm-spec2k6-O3linaro-local/ci/tcwg_bmk_llvm_apm/llvm-release-arm-spec2k6-Ozlinaro-local/ci/tcwg_bmk_llvm_apm/llvm-release-aarch64-spec2k6-Os_LTOlinaro-local/ci/tcwg_bmk_gnu_tx1/gnu-release-aarch64-spec2k6-O2_LTO
Currently the _Dir::open_subdir function decides whether to construct a
_Dir_base with just a pathname, or a file descriptor and pathname. But
that means it is tightly coupled to the implementation of
_Dir_base::openat, which is what actually decides whether to use a file
descriptor or not. If the derived class passes a file descriptor and
filename, but the base class expects a full path and ignores the file
descriptor, then recursive_directory_iterator cannot recurse.
This change introduces a new type that provides the union of all the
information available to the derived class (the full pathname, as well
as a file descriptor for a directory and another pathname relative to
that directory). This allows the derived class to be agnostic to how the
base class will use that information.
libstdc++-v3/ChangeLog:
* src/c++17/fs_dir.cc (_Dir::dir_and_pathname):: Replace with
current() returning _At_path.
(_Dir::_Dir, _Dir::open_subdir, _Dir::do_unlink): Adjust.
* src/filesystem/dir-common.h (_Dir_base::_At_path): New class.
(_Dir_base::_Dir_Base, _Dir_base::openat): Use _At_path.
* src/filesystem/dir.cc (_Dir::dir_and_pathname): Replace with
current() returning _At_path.
(_Dir::_Dir, _Dir::open_subdir): Adjust.
(cherry picked from commit 198781144f33b0ef17dd2094580b5c77ad97d6e8)
Diffstat (limited to 'libgcc')
0 files changed, 0 insertions, 0 deletions