libstdc++: check for openat with dirfd in std::filesystem

In the recent patch to check for openat, I missed an occurrence of
dirfd in std::filesystem.


for  libstdc++-v3/ChangeLog

	* src/c++17/fs_dir.cc (dir_and_pathname): Use dirfd if
	_GLIBCXX_HAVE_OPENAT.
This commit is contained in:
Alexandre Oliva 2022-06-27 10:34:16 -03:00 committed by Alexandre Oliva
parent ca35ebaec8
commit 486893b1d3
1 changed files with 1 additions and 1 deletions

View File

@ -124,7 +124,7 @@ struct fs::_Dir : _Dir_base
dir_and_pathname() const noexcept
{
const fs::path& p = entry.path();
#if _GLIBCXX_HAVE_DIRFD
#if _GLIBCXX_HAVE_DIRFD && _GLIBCXX_HAVE_OPENAT
if (!p.empty())
return {::dirfd(this->dirp), std::prev(p.end())->c_str()};
#endif