mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +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
|
@ -1,3 +1,10 @@
|
|||
2014-02-02 Riccardo Mottola <rm@gnu.org>
|
||||
|
||||
* Source/NSString.m (stringByResolvingSymlinksInPath)
|
||||
On GLIBC and FreeBSD use sysconf(_SC_SYMLOOP_MAX) instead of just
|
||||
MAXSYMLINKS. For HURD this is necessary, since the latter is not
|
||||
defined.
|
||||
|
||||
2014-01-31 Marcus Mueller <znek@mulle-kybernetik.com>
|
||||
|
||||
* Source/NSUserNotification.m:
|
||||
|
|
|
@ -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…
Reference in a new issue