summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-07-30 12:16:34 +0000
committerJim Meyering <jim@meyering.net>2007-07-30 12:16:34 +0000
commit09c479ebb512014ad2ffdd1a71efe37276475663 (patch)
treeb8b194cfcb1d9406721b19cce0ca9a193c9663fe /lib
parent5e942637dc329a612277f45207a7b1aadc46a9b3 (diff)
downloadgnulib-09c479ebb512014ad2ffdd1a71efe37276475663.tar.gz
* lib/fts.c (fts_read): Upon failure to chdir into a subdirectory,
set fts_info to FTS_DNR, not to FTS_ERR, so that the caller knows it has valid stat data. This bug would cause du not to count the sizes of inaccessible directories. Patch by Jose Maria Plans, reported in http://bugzilla.redhat.com/250077
Diffstat (limited to 'lib')
-rw-r--r--lib/fts.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/fts.c b/lib/fts.c
index 1b5384b007..ccf6b19f0a 100644
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -685,7 +685,7 @@ fts_read (register FTS *sp)
/* If fts_build's call to fts_safe_changedir failed
because it was not able to fchdir into a
subdirectory, tell the caller. */
- if (p->fts_errno)
+ if (p->fts_errno && p->fts_info != FTS_DNR)
p->fts_info = FTS_ERR;
LEAVE_DIR (sp, p, "2");
return (p);