Re: [PATCH v4 0/5] road to reentrant real_path
- From
Torsten Bögershausen <tboegi@web.de>
- Date
- Jan 4, 2017, 06:56 UTC
- Message-ID
- <3f9a530c-402f-f276-4721-fa6a8a6fef41@web.de>
- In-Reply-To
- <20170104004825.3s27dsircdp5lqte@sigill.intra.peff.net>
On 04.01.17 01:48, Jeff King wrote:
Show 15 quoted lines
> On Tue, Jan 03, 2017 at 11:09:18AM -0800, Brandon Williams wrote: > >> Only change with v4 is in [1/5] renaming the #define MAXSYMLINKS back to >> MAXDEPTH due to a naming conflict brought up by Lars Schneider. > > Hmm. Isn't MAXSYMLINKS basically what you want here, though? It what's > what all other similar functions will be using. > > The only problem was that we were redefining the macro. So maybe: > > #ifndef MAXSYMLINKS > #define MAXSYMLINKS 5 > #endif > > would be a good solution?
Why 5 ? (looking at the 20..30 below) And why 5 on one system and e.g. on my Mac OS #define MAXSYMLINKS 32
Would the same value value for all Git installations on all platforms make sense? #define GITMAXSYMLINKS 20
Show 10 quoted lines
> > It looks like the "usual" value is more like 20 or 30 on most systems, > though. We should probably also set errno to ELOOP when we hit the > limit, which is what other symlink-resolving functions would do. > > I'm surprised we didn't hit this on Linux, which has MAXSYMLINKS, too. > We should be picking it up from <sys/param.h>. > > -Peff >