Re: [PATCH][RESEND] apply the struct dirent penalty only when needed

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

 



On Oct 12 11:57, Rolf Eike Beer wrote:
> Subject: [PATCH 1/3] apply the struct dirent penalty only when needed
> 
> Many systems have a struct dirent that already has enough space to hold the
> entries names, others like Solaris have not. For the latter extra space needs
> to be allocated, but this was also done for the former systems leading to
> needlessly reserved memory.
> ---
>  sftp-glob.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 
> diff --git a/sftp-glob.c b/sftp-glob.c
> index 43a1beba..8edd28ac 100644
> --- a/sftp-glob.c
> +++ b/sftp-glob.c
> @@ -64,9 +64,14 @@ fudge_opendir(const char *path)
>  static struct dirent *
>  fudge_readdir(struct SFTP_OPENDIR *od)
>  {
> +#ifdef BROKEN_ONE_BYTE_DIRENT_D_NAME
>  	/* Solaris needs sizeof(dirent) + path length (see below) */
>  	static char buf[sizeof(struct dirent) + MAXPATHLEN];

I know this code was already there, but isn't MAXPATHLEN rather wasteful?
Shouldn't that be NAME_LEN + 1 instead?


Corinna

-- 
Corinna Vinschen
Cygwin Maintainer
Red Hat

Attachment: signature.asc
Description: PGP signature

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@xxxxxxxxxxx
https://lists.mindrot.org/mailman/listinfo/openssh-unix-dev

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux