mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
On GLIBC and FreeBSD use sysconf(_SC_SYMLOOP_MAX) instead of just MAXSYMLINKS.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@37665 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8e9f2d35cd
commit
da8b642b35
2 changed files with 14 additions and 1 deletions
|
@ -4558,6 +4558,12 @@ static NSFileManager *fm = nil;
|
|||
#else
|
||||
|
||||
{
|
||||
#if defined(__GLIBC__) || defined(__FreeBSD__)
|
||||
#define GS_MAXSYMLINKS sysconf(_SC_SYMLOOP_MAX)
|
||||
#else
|
||||
#define GS_MAXSYMLINKS MAXSYMLINKS
|
||||
#endif
|
||||
|
||||
#ifndef PATH_MAX
|
||||
#define PATH_MAX 1024
|
||||
/* Don't use realpath unless we know we have the correct path size limit */
|
||||
|
@ -4655,7 +4661,7 @@ static NSFileManager *fm = nil;
|
|||
char buf[PATH_MAX];
|
||||
int l;
|
||||
|
||||
if (++num_links > MAXSYMLINKS)
|
||||
if (++num_links > GS_MAXSYMLINKS)
|
||||
{
|
||||
return IMMUTABLE(self); /* Too many links. */
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue