diff options
author | Jim Meyering <jim@meyering.net> | 2004-03-28 21:43:50 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2004-03-28 21:43:50 +0000 |
commit | ca6d256f125ea496cdb059a201f92f77f1ce0c69 (patch) | |
tree | 0b6e00b1c3fb0ad634d70ec51cdd306c71ce1d2c /src/du.c | |
parent | 9e77380c9f7a0bc0f3287ec1c41a36f890e68469 (diff) | |
download | coreutils-ca6d256f125ea496cdb059a201f92f77f1ce0c69.tar.xz |
Minor optimization:
(process_file): Don't record dev/inode for directories.
Under some circumstances, without -c, du would mistakenly count the
space of hard-linked files, not just the first one it encountered.
Reported by Anthony Thyssen.
(du_files): Don't ever clear the set of `seen' dev/inodes.
Diffstat (limited to 'src/du.c')
-rw-r--r-- | src/du.c | 7 |
1 files changed, 1 insertions, 6 deletions
@@ -377,6 +377,7 @@ process_file (FTS *fts, FTSENT *ent) via a hard link, then don't let it contribute to the sums. */ if (skip || (!opt_count_all + && ! S_ISDIR (sb->st_mode) && 1 < sb->st_nlink && hash_ins (sb->st_ino, sb->st_dev))) { @@ -518,12 +519,6 @@ du_files (char **files, int bit_flags) } FTS_CROSS_CHECK (fts); - /* This is a space optimization. If we aren't printing totals, - then it's ok to clear the duplicate-detection tables after - each command line hierarchy has been processed. */ - if (ent->fts_level == 0 && ent->fts_info == FTS_D && !print_grand_total) - hash_clear (htab); - process_file (fts, ent); } |