summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>2007-07-31 10:46:31 +0200
committerJim Meyering <jim@meyering.net>2007-07-31 12:10:11 +0200
commitfd9a6e860b7f196728a975599947a09a316be260 (patch)
tree31d53da2df9076c53cb89d75cc77b37b022d7f40 /src
parent3b03442c5423562749982e159111782db6812b14 (diff)
downloadcoreutils-fd9a6e860b7f196728a975599947a09a316be260.tar.xz
du: print size (probably incomplete) of each inaccessible directory
* src/du.c (process_file): Print what we know of the size of a directory even when it is inaccessible. What we print is just the size of the directory itself, not counting any of its contents. * tests/du/inacc-dir: Test for this. * NEWS: Mention this change. Signed-off-by: Jim Meyering <jim@meyering.net>
Diffstat (limited to 'src')
-rw-r--r--src/du.c7
1 files changed, 1 insertions, 6 deletions
diff --git a/src/du.c b/src/du.c
index 57678d93e..f9bd2e364 100644
--- a/src/du.c
+++ b/src/du.c
@@ -596,14 +596,9 @@ process_file (FTS *fts, FTSENT *ent)
duinfo_add (&dulvl[level].ent, &dui);
/* Even if this directory is unreadable or we can't chdir into it,
- do let its size contribute to the total, ... */
+ do let its size contribute to the total. */
duinfo_add (&tot_dui, &dui);
- /* ... but don't print out a total for it, since without the size(s)
- of any potential entries, it could be very misleading. */
- if (ent->fts_info == FTS_DNR)
- return ok;
-
/* If we're not counting an entry, e.g., because it's a hard link
to a file we've already counted (and --count-links), then don't
print a line for it. */