From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 5A842383577A; Tue, 28 Jun 2022 11:08:44 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5A842383577A MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r13-1320] libstdc++: Do not optimize away storing pathname if it's needed X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/master X-Git-Oldrev: 020b7d98589bbc928b5a66b1ed56b42af8791355 X-Git-Newrev: 835b19936bf30d693783bfa39145a4ce243bbd7c Message-Id: <20220628110844.5A842383577A@sourceware.org> Date: Tue, 28 Jun 2022 11:08:44 +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: Tue, 28 Jun 2022 11:08:44 -0000 https://gcc.gnu.org/g:835b19936bf30d693783bfa39145a4ce243bbd7c commit r13-1320-g835b19936bf30d693783bfa39145a4ce243bbd7c Author: Jonathan Wakely Date: Tue Jun 28 09:26:12 2022 +0100 libstdc++: Do not optimize away storing pathname if it's needed libstdc++-v3/ChangeLog: * src/c++17/fs_dir.cc (_Dir::_Dir) [!_GLIBCXX_HAVE_OPENAT]: Always store pathname if we don't have openat or unlinkat, because the full path is needed to open sub-directories and remove entries. 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 25b33baa875..025317b0a08 100644 --- a/libstdc++-v3/src/c++17/fs_dir.cc +++ b/libstdc++-v3/src/c++17/fs_dir.cc @@ -48,7 +48,7 @@ struct fs::_Dir : _Dir_base [[maybe_unused]] bool filename_only, error_code& ec) : _Dir_base(fdcwd(), p.c_str(), skip_permission_denied, nofollow, ec) { -#if _GLIBCXX_HAVE_DIRFD +#if _GLIBCXX_HAVE_DIRFD && _GLIBCXX_HAVE_OPENAT && _GLIBCXX_HAVE_UNLINKAT if (filename_only) return; // Do not store path p when we aren't going to use it. #endif