[prev in list] [next in list] [prev in thread] [next in thread] 

List:       hurd-bug
Subject:    Re: [PATCH 6/8] killall5.c: Use sysconf(_SC_SYMLOOP_MAX) instead of MAXSYMLINKS.
From:       Pino Toscano <toscano.pino () tiscali ! it>
Date:       2013-07-22 14:10:08
Message-ID: 201307221610.12578.toscano.pino () tiscali ! it
[Download RAW message or body]


Alle marted́ 9 luglio 2013, Justus Winter ha scritto:
> index 5937d98..02ac88f 100644
> --- a/src/killall5.c
> +++ b/src/killall5.c
> @@ -373,7 +373,7 @@ int check4nfs(const char * path, char * real)
>  {
>  	char buf[PATH_MAX+1];
>  	const char *curr;
> -	int deep = MAXSYMLINKS;
> +	int deep = sysconf(_SC_SYMLOOP_MAX);

While certainly better, I just verified that such sysconf returns -1 on 
Linux and kFreeBSD; thus, maybe it would make more sense to move this 
code in a small function, which would first use sysconf falling back (if 
returning <= 0) to MAXSYMLINKS if defined.

-- 
Pino Toscano

["signature.asc" (application/pgp-signature)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic