From owner-freebsd-bugs Sun Dec 1 5:10:12 2002 Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 373F737B404 for ; Sun, 1 Dec 2002 05:10:10 -0800 (PST) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7034A43EB2 for ; Sun, 1 Dec 2002 05:10:09 -0800 (PST) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.12.6/8.12.6) with ESMTP id gB1DA9x3019552 for ; Sun, 1 Dec 2002 05:10:09 -0800 (PST) (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.12.6/8.12.6/Submit) id gB1DA9eL019551; Sun, 1 Dec 2002 05:10:09 -0800 (PST) Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 74FED37B401 for ; Sun, 1 Dec 2002 05:09:04 -0800 (PST) Received: from athena.ginganet.org (tk0008-202x210x243x26.ap-TK.usen.ad.jp [202.210.243.26]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6180143EB2 for ; Sun, 1 Dec 2002 05:09:00 -0800 (PST) (envelope-from ginga@athena.ginganet.org) Received: by athena.ginganet.org (Postfix, from userid 5003) id 2EAC33E58; Sun, 1 Dec 2002 22:08:54 +0900 (JST) Message-Id: <20021201130854.2EAC33E58@athena.ginganet.org> Date: Sun, 1 Dec 2002 22:08:54 +0900 (JST) From: Kawaguti Ginga Reply-To: Kawaguti Ginga To: FreeBSD-gnats-submit@FreeBSD.org Cc: ginga-freebsd@ginganet.org X-Send-Pr-Version: 3.113 Subject: bin/45897: /usr/bin/du option -h -k conflicts. Sender: owner-freebsd-bugs@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org >Number: 45897 >Category: bin >Synopsis: /usr/bin/du option -h -k conflicts. >Confidential: no >Severity: non-critical >Priority: medium >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Sun Dec 01 05:10:01 PST 2002 >Closed-Date: >Last-Modified: >Originator: Kawaguti Ginga >Release: FreeBSD 4.7-RC i386 >Organization: >Environment: System: FreeBSD 4.7-RC i386 >Description: /usr/bin/du 's option -h and -k conflicts when -k is added AFTER -h option. When -k option is provided after -h option, it reports half the amount of data. >How-To-Repeat: % mkdir /tmp/test % cd /tmp/test % dd if=/dev/zero of=foo count=100 # 5kB % ls -l foo -rw-r--r-- 1 ginga wheel 51200 Dec 1 21:59 foo % du -sk . 51 . % du -skh . 51K . # right % du -shk . 26K . # wrong! (only 1/2 reported) % >Fix: --- /usr/src/usr.bin/du/du.c Thu Jul 12 17:46:53 2001 +++ du.c Sun Dec 1 21:51:45 2002 @@ -167,7 +167,9 @@ valp = vals_base2; break; case 'k': - putenv("BLOCKSIZE=1024"); + if (hflag == 0){ + putenv("BLOCKSIZE=1024"); + } break; case 'r': /* Compatibility. */ break; --- /usr/src/usr.bin/du/du.1 Fri Jun 21 08:45:43 2002 +++ du.1 Sun Dec 1 22:05:01 2002 @@ -97,7 +97,7 @@ .It Fl c Display a grand total. .It Fl k -Display block counts in 1024-byte (1-Kbyte) blocks. +Display block counts in 1024-byte (1-Kbyte) blocks(not valid when applied with -h). .It Fl x Filesystem mount points are not traversed. .El >Release-Note: >Audit-Trail: >Unformatted: To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message