From owner-freebsd-standards@FreeBSD.ORG Wed Sep 20 20:34:48 2006 Return-Path: X-Original-To: freebsd-standards@freebsd.org Delivered-To: freebsd-standards@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id BF89A16A412; Wed, 20 Sep 2006 20:34:48 +0000 (UTC) (envelope-from toby@apple.com) Received: from mail-out3.apple.com (mail-out3.apple.com [17.254.13.22]) by mx1.FreeBSD.org (Postfix) with ESMTP id B0A6443D68; Wed, 20 Sep 2006 20:34:44 +0000 (GMT) (envelope-from toby@apple.com) Received: from relay6.apple.com (relay6.apple.com [17.128.113.36]) by mail-out3.apple.com (8.12.11/8.12.11) with ESMTP id k8KKYsGO027148; Wed, 20 Sep 2006 13:34:54 -0700 (PDT) Received: from [17.219.215.171] (unknown [17.219.215.171]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client certificate requested) by relay6.apple.com (Apple SCV relay) with ESMTP id 113BE1EF; Wed, 20 Sep 2006 13:34:44 -0700 (PDT) In-Reply-To: <20060920172920.B59572@delplex.bde.org> References: <45101C0E.4010202@FreeBSD.org> <20060920172920.B59572@delplex.bde.org> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <5EF9942D-B040-4BAC-9679-7CA909024A55@apple.com> Content-Transfer-Encoding: 7bit From: Toby Peterson Date: Wed, 20 Sep 2006 13:34:33 -0700 To: Bruce Evans X-Mailer: Apple Mail (2.752.2) X-Brightmail-Tracker: AAAAAA== Cc: freebsd-standards@freebsd.org, "Christian S.J. Peron" Subject: Re: [Fwd: Re: df -kP != df -Pk] X-BeenThere: freebsd-standards@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Standards compliance List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 20 Sep 2006 20:34:48 -0000 On 20 September 2006, at 01.04.42, Bruce Evans wrote: > On Tue, 19 Sep 2006, Christian S.J. Peron wrote: > >> Anyone have any objections to me committing this patch? > > % @@ -123,6 +123,7 @@ > % case 'b': > % /* FALLTHROUGH */ > % case 'P': > % + Pflag++; > > Why not just "if (kflag) break;" here? > > % putenv("BLOCKSIZE=512"); > % hflag = 0; > % break; > % @@ -171,6 +173,12 @@ > % argc -= optind; > % argv += optind; > % % + /* > % + * POSIX specifies that if both -P and -k options are used > together a > % + * 1k blocksize should be used. > % + */ > % + if (Pflag != 0 && kflag != 0) > % + putenv("BLOCKSIZE=1k"); > > Then this would not be needed (except for the comment). > > POSIX actually requires BLOCKSIZE to be set to 1024, not to 1k, so > that the > header says 1024 and not 1k. df -k causes the wrong output now and > the > above preserves this bug. This is essentially what our (Apple's) patches to df do. -P does nothing if -k is set, and -k sets BLOCKSIZE=1024. - Toby