From nobody Fri Jan 9 20:17:25 2026 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4dntNk2s0Lz6MJyT for ; Fri, 09 Jan 2026 20:17:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4dntNj65Zbz3KP4 for ; Fri, 09 Jan 2026 20:17:25 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767989845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XM90dZyvx9m6XwUXTWAZi/1KQff8b8ufn3iQtcV2gYE=; b=bh6X/lVLnTF4ZOzVpeQnQMfHhHcL1J9ZcsL1KOuFobL6pVJchej+XLx93pH264vGMUmHOn g2KLc/VbUDYg7FGiQ38vUu/iVc1/M7aaDZdW5n+y3W6J3z2ooSs9NYzqZvf8eOqX1X3AFL ajvDThy+3Pg2FdJgeFFBImEySSEhv6GR2Tcau0idmGvmb5Vxxpos2uKfcSBK+p35S1RJGi VdCZ/VWOI/3Pr3BgiQ8Zv84QA4fHipzqozZ5hUoRysJE/gV4Y+38iHqhSKwJIC/x0bpNtH r+T4lpcWf40JI2N8zU5aEVfIhnVAPM9l5dYm14He/st9ZJ8NM71jwkDrirWOIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1767989845; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XM90dZyvx9m6XwUXTWAZi/1KQff8b8ufn3iQtcV2gYE=; b=DVeVcRDaRPhOHrGUaZ4cJXS85GLCtr103zCYPr0NkDtWoC/fZ4yulABf3WmIQpJxzx8xsn DxHqw9wv61Mice5186fw0dwBMUH7zMPvBJYqCHuwkeqzXyzjEZhPYruLYs3ClSKQG+4Wt/ 0nTViU388L21TSTBY50KDn6eBBPpfjQQVgo6z8L8EipYzCVfwaG3zW25X/2rGqZMewphE+ psqqgdB6qDfX5YzbJLCrFKc/vqIn+TQ2Ejp5yVvtJAB96tvzvAFXta78chDJjsVEG0s0O6 dV5wLnGlZGD9Gs1+oblQBpB0QmWBFNI9sfcvtWIUrflGUUkwA+wci8GvIG5YhQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1767989845; a=rsa-sha256; cv=none; b=sjZGeDYr71/w2HygSH6Dle6kVOnsRE5E6h52nExamp8Rs1R8fBqxBuyQ9aGlCBhrI24sNg vZE2P7Q/krlWxV7/HvZomU4ny6ckpUyFZjY/q8+6Fr32hep9wEDjMZSSMmYHgAyG4W7XHS GyfHLYQR9mBbOg1vrbaRCPeptWxEzSRIUpRLh3hvNu79aaY/FZwjjqwNjjPT1AtDmd4U5d jL5+3zVVLngYMu7ies0w+U1X4QQr2A8ASdUMyY4whGkcjkqNcSFl0kka8xnhbaiCttoUuL CsaIglKzduYkzKgqXLOqupBlTIEGjdNqyd1DmBlMFXf9AcVuezE7QW9t6Jj+Kg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4dntNj5fmfz7v6 for ; Fri, 09 Jan 2026 20:17:25 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 8a01 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Fri, 09 Jan 2026 20:17:25 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Ankush Mondal From: Warner Losh Subject: git: 539547151678 - main - df: Fix -k flag consistency with other BLOCKSIZE flags List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-all@freebsd.org Sender: owner-dev-commits-src-all@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 539547151678c63903dddda214b16b177cf418b8 Auto-Submitted: auto-generated Date: Fri, 09 Jan 2026 20:17:25 +0000 Message-Id: <69616255.8a01.65a8a4dc@gitrepo.freebsd.org> The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=539547151678c63903dddda214b16b177cf418b8 commit 539547151678c63903dddda214b16b177cf418b8 Author: Ankush Mondal AuthorDate: 2025-11-29 11:15:30 +0000 Commit: Warner Losh CommitDate: 2026-01-09 20:17:12 +0000 df: Fix -k flag consistency with other BLOCKSIZE flags This patch resolves inconsistent behavior between the -k option and other related flags, including -P. Previously, using -k resulted in output displayed in 1024-byte blocks, which did not align with the behavior of similar options such as -m and -g, where output is shown in 1M-blocks and 1G-blocks respectively. The updated implementation ensures that -k now correctly displays sizes in 1K-blocks. In addition, the patch incorporates the POSIX requirement that when both -k -P are specified, the block size must be explicitly forced to 1024-blocks. Together, these changes make the behavior of -k consistent, predictable, and compliant with the standard. Signed-off-by: Ankush Mondal Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/1906 --- bin/df/df.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/bin/df/df.c b/bin/df/df.c index db5b8b18beae..12478d23a2ea 100644 --- a/bin/df/df.c +++ b/bin/df/df.c @@ -128,11 +128,12 @@ main(int argc, char *argv[]) /* * POSIX specifically discusses the behavior of * both -k and -P. It states that the blocksize should - * be set to 1024. Thus, if this occurs, simply break - * rather than clobbering the old blocksize. + * be set to 1024. */ - if (kflag) + if (kflag) { + setenv("BLOCKSIZE", "1024", 1); break; + } setenv("BLOCKSIZE", "512", 1); hflag = 0; break; @@ -154,7 +155,7 @@ main(int argc, char *argv[]) break; case 'k': kflag++; - setenv("BLOCKSIZE", "1024", 1); + setenv("BLOCKSIZE", "1k", 1); hflag = 0; break; case 'l':