From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2140) id DA9A9386F471; Mon, 27 Jun 2022 09:33:22 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DA9A9386F471 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Alexandre Oliva To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc(refs/users/aoliva/heads/testme)] libstdc++: check for openat with dirfd in std::filesystem X-Act-Checkin: gcc X-Git-Author: Alexandre Oliva X-Git-Refname: refs/users/aoliva/heads/testme X-Git-Oldrev: 23339df51f4f1c6c5f29e7abfe1c5b1aad1f7bb0 X-Git-Newrev: e7f27b5e6b1d44122898b0ac312f1c462dbfa725 Message-Id: <20220627093322.DA9A9386F471@sourceware.org> Date: Mon, 27 Jun 2022 09:33:22 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Jun 2022 09:33:23 -0000 https://gcc.gnu.org/g:e7f27b5e6b1d44122898b0ac312f1c462dbfa725 commit e7f27b5e6b1d44122898b0ac312f1c462dbfa725 Author: Alexandre Oliva Date: Mon Jun 27 05:30:57 2022 -0300 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. Diff: --- libstdc++-v3/src/c++17/fs_dir.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libstdc++-v3/src/c++17/fs_dir.cc b/libstdc++-v3/src/c++17/fs_dir.cc index c67fe76bc14..25b33baa875 100644 --- a/libstdc++-v3/src/c++17/fs_dir.cc +++ b/libstdc++-v3/src/c++17/fs_dir.cc @@ -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