mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-14 01:50:35 +08:00
Fix filesystem::canonical on Solaris 10.
PR libstdc++/67173 * src/filesystem/ops.cc (filesystem::canonical): Allocate buffer for realpath on Solaris 10. From-SVN: r227689
This commit is contained in:
parent
42b6aad9ef
commit
7c928f726d
@ -1,5 +1,9 @@
|
||||
2015-09-11 Jonathan Wakely <jwakely@redhat.com>
|
||||
|
||||
PR libstdc++/67173
|
||||
* src/filesystem/ops.cc (filesystem::canonical): Allocate buffer for
|
||||
realpath on Solaris 10.
|
||||
|
||||
PR libstdc++/65142
|
||||
* src/c++11/random.cc (random_device::_M_getval()): Check read result.
|
||||
|
||||
|
@ -28,6 +28,7 @@
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h> // PATH_MAX
|
||||
#ifdef _GLIBCXX_HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
# if defined(_GLIBCXX_HAVE_SYS_STAT_H) && defined(_GLIBCXX_HAVE_SYS_TYPES_H)
|
||||
@ -97,7 +98,11 @@ fs::canonical(const path& p, const path& base, error_code& ec)
|
||||
{
|
||||
path can;
|
||||
#ifdef _GLIBCXX_USE_REALPATH
|
||||
if (char_ptr rp = char_ptr{::realpath(absolute(p, base).c_str(), nullptr)})
|
||||
char* buffer = nullptr;
|
||||
#if defined(__SunOS_5_10) && defined(PATH_MAX)
|
||||
buffer = (char*)::malloc(PATH_MAX);
|
||||
#endif
|
||||
if (char_ptr rp = char_ptr{::realpath(absolute(p, base).c_str(), buffer)})
|
||||
{
|
||||
can.assign(rp.get());
|
||||
ec.clear();
|
||||
|
Loading…
x
Reference in New Issue
Block a user