libstdc++: Fix build for targets without lstat [PR 94681]

libstdc++-v3/ChangeLog:

	PR libstdc++/94681
	* src/c++17/fs_ops.cc (read_symlink): Use posix::lstat instead
	of calling ::lstat directly.
	* src/filesystem/ops.cc (read_symlink): Likewise.
This commit is contained in:
Jonathan Wakely 2020-08-10 18:58:14 +01:00
parent ed11f7e84b
commit 5b065f0563
2 changed files with 2 additions and 2 deletions

View File

@ -1175,7 +1175,7 @@ fs::path fs::read_symlink(const path& p, error_code& ec)
path result;
#if defined(_GLIBCXX_HAVE_READLINK) && defined(_GLIBCXX_HAVE_SYS_STAT_H)
stat_type st;
if (::lstat(p.c_str(), &st))
if (posix::lstat(p.c_str(), &st))
{
ec.assign(errno, std::generic_category());
return result;

View File

@ -993,7 +993,7 @@ fs::path fs::read_symlink(const path& p [[gnu::unused]], error_code& ec)
path result;
#if defined(_GLIBCXX_HAVE_READLINK) && defined(_GLIBCXX_HAVE_SYS_STAT_H)
stat_type st;
if (::lstat(p.c_str(), &st))
if (posix::lstat(p.c_str(), &st))
{
ec.assign(errno, std::generic_category());
return result;