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; -- 1.6.4.2 _______________________________________________ xorg-devel mailing list [email protected] http://lists.x.org/mailman/listinfo/xorg-devel
