summaryrefslogtreecommitdiff
path: root/src/du.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2011-12-14 18:00:42 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2011-12-14 18:04:05 -0800
commitcfe1040c093be1c1a9b2403e713f1d1c2242a4bc (patch)
tree14de0a5fc39a117ea2d44e5cb297475585eb22fa /src/du.c
parent021a0664093506394fd8ee0a789ebfe6e6b69deb (diff)
downloadcoreutils-cfe1040c093be1c1a9b2403e713f1d1c2242a4bc.tar.xz
du: -x should not count files in other file systems
This fixes Bug#10293, which I guess was introduced in commit 95c948b06a dated 2003-10-02. * NEWS: Document fix. * src/du.c (process_file): Don't count files in different file systems if -x is given. * tests/du/one-file-system: Test for this bug.
Diffstat (limited to 'src/du.c')
-rw-r--r--src/du.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/du.c b/src/du.c
index fba7f7d60..a8dfd28f1 100644
--- a/src/du.c
+++ b/src/du.c
@@ -443,6 +443,9 @@ process_file (FTS *fts, FTSENT *ent)
error (0, ent->fts_errno, _("cannot access %s"), quote (file));
return false;
}
+
+ if (fts->fts_options & FTS_XDEV && fts->fts_dev != sb->st_dev)
+ excluded = true;
}
if (excluded