Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 20 Sep 2006 15:56:25 -0500
From:      "Christian S.J. Peron" <csjp@FreeBSD.org>
To:        Toby Peterson <toby@apple.com>
Cc:        freebsd-standards@freebsd.org
Subject:   Re: [Fwd: Re: df -kP != df -Pk]
Message-ID:  <4511AAF9.1050804@FreeBSD.org>
In-Reply-To: <5EF9942D-B040-4BAC-9679-7CA909024A55@apple.com>
References:  <45101C0E.4010202@FreeBSD.org> <20060920172920.B59572@delplex.bde.org> <5EF9942D-B040-4BAC-9679-7CA909024A55@apple.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Toby Peterson wrote:
> 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
>
>
I just committed this to -CURRENT, as we as changing "1k" to "1024".

-- 
Christian S.J. Peron
csjp@FreeBSD.ORG
FreeBSD Committer
FreeBSD Security Team




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