From nobody Mon Mar 29 14:55:43 2004 From: Jim Meyering Subject: Re: DU and hard links To: Anthony Thyssen Cc: bug-coreutils@gnu.org Date: Sun, 28 Mar 2004 23:45:36 +0200 Anthony Thyssen wrote: > I have a series of backup home directories what use hardlinks on files > that have not changed. If I run "du" on these directories I get > a disk usage summery as if the directories are not hard linked together! Actually, I see now that there is a bug. Thank you for reporting it. Here's a fix: 2004-03-28 Jim Meyering 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. * src/du.c (du_files): Don't ever clear the set of `seen' dev/inodes. Index: src/du.c =================================================================== RCS file: /fetish/cu/src/du.c,v retrieving revision 1.192 diff -u -p -u -p -r1.192 du.c --- coreutils-5.2.1/src/du.c 27 Mar 2004 15:44:23 -0000 1.192 +++ coreutils-5.2.1/src/du.c 28 Mar 2004 08:13:42 -0000 @@ -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_totals) - hash_clear (htab); - process_file (fts, ent); } _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://mail.gnu.org/mailman/listinfo/bug-coreutils