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:
parent
ed11f7e84b
commit
5b065f0563
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user