From 09c479ebb512014ad2ffdd1a71efe37276475663 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Mon, 30 Jul 2007 12:16:34 +0000 Subject: [PATCH] * 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 --- ChangeLog | 8 ++++++++ lib/fts.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e3286fba7c..b9f9d29e95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-07-30 Jim Meyering + + * 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 + 2007-07-25 Peter O'Gorman Bruno Haible 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); -- 2.30.2