Date: Wed, 20 Sep 2006 13:34:33 -0700 From: Toby Peterson <toby@apple.com> To: Bruce Evans <bde@zeta.org.au> Cc: freebsd-standards@freebsd.org, "Christian S.J. Peron" <csjp@freebsd.org> Subject: Re: [Fwd: Re: df -kP != df -Pk] Message-ID: <5EF9942D-B040-4BAC-9679-7CA909024A55@apple.com> In-Reply-To: <20060920172920.B59572@delplex.bde.org> References: <45101C0E.4010202@FreeBSD.org> <20060920172920.B59572@delplex.bde.org>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5EF9942D-B040-4BAC-9679-7CA909024A55>