Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 11 Sep 1998 14:01:20 GMT
From:      Zach Heilig <zach@gaffaneys.com>
To:        FreeBSD-gnats-submit@FreeBSD.ORG
Subject:   bin/7896: du -c gets totals wrong...
Message-ID:  <199809111401.OAA09530@k6n1.znh.org>

next in thread | raw e-mail | index | archive | help

>Number:         7896
>Category:       bin
>Synopsis:       du -c gets totals wrong
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Sep 11 07:10:01 PDT 1998
>Last-Modified:
>Originator:     Zach Heilig
>Organization:
none
>Release:        FreeBSD 3.0-CURRENT i386 (& FreeBSD 2.2.7-STABLE i386)
>Environment:

	

>Description:

du -c simply puts out the numbers in the last directory visited.

>How-To-Repeat:

[before fix:]
$ cd /usr/src/bin
$ du -c ed ls
4       ed/CVS
10      ed/test/CVS
165     ed/test
290     ed
4       ls/CVS
60      ls
60      total
$ 
[after fix:]
$ cd /usr/src/bin
$ du -c ed ls
4       ed/CVS
10      ed/test/CVS
165     ed/test
290     ed
4       ls/CVS
60      ls
350     total
$

>Fix:
Both -stable and -current need this fix:

Index: du.c
===================================================================
RCS file: /fs/ncvs/src/usr.bin/du/du.c,v
retrieving revision 1.12
diff -u -r1.12 du.c
--- du.c	1998/07/29 17:50:06	1.12
+++ du.c	1998/09/11 13:50:48
@@ -214,7 +214,7 @@
 
 				p->fts_parent->fts_number += p->fts_statp->st_blocks;
 		}
-		savednumber = p->fts_number;
+		savednumber = p->fts_parent->fts_number;
 	}
 
 	if (errno)
>Audit-Trail:
>Unformatted:

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199809111401.OAA09530>