Pushed (though I had to add a #include <limits.h> to make it build on
Solaris).
-alan-
Yaakov (Cygwin/X) wrote:
> From: Eric Blake <[email protected]>
>
> Normally, any directory has a st_nlink of at least 2 (. and ..).
> On some systems, a directory's st_nlink is set to 1 where it is too
> expensive to compute the correct value (e.g. remote filesystems).
> Instead of treating this as a legitimate value (i.e. that the directory
> contains nothing to link from), special case this and force a complete
> scan of the directory's contents.
>
> Further explanation:
> http://cygwin.com/ml/cygwin/2008-06/msg00056.html
> http://cygwin.com/ml/cygwin-apps/2008-08/msg00264.html
>
> Signed-off-by: Yaakov Selkowitz <[email protected]>
> ---
> lndir.c | 2 ++
> 1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/lndir.c b/lndir.c
> index 4d63c1c..5ca591a 100644
> --- a/lndir.c
> +++ b/lndir.c
> @@ -182,6 +182,8 @@ dodir (char *fn, /* name of "from" directory,
> either absolute or
> if (*(p - 1) != '/')
> *p++ = '/';
> n_dirs = fs->st_nlink;
> + if (n_dirs == 1)
> + n_dirs = INT_MAX;
> while ((dp = readdir (df))) {
> if (dp->d_name[strlen(dp->d_name) - 1] == '~')
> continue;
--
-Alan Coopersmith- [email protected]
Sun Microsystems, Inc. - X Window System Engineering
_______________________________________________
xorg-devel mailing list
[email protected]
http://lists.x.org/mailman/listinfo/xorg-devel