]> git.ipfire.org Git - thirdparty/util-linux.git/commit
bits: add --fail-width option to reject out-of-range CPU numbers
authorWanBingjiang <wanbingjiang@webray.com.cn>
Thu, 7 May 2026 01:47:25 +0000 (09:47 +0800)
committerWanBingjiang <wanbingjiang@webray.com.cn>
Thu, 7 May 2026 01:52:16 +0000 (09:52 +0800)
commit2b49ffe227219adfe18525a5463a105a3bdebfe3
treee672cda6de6bf80e2e177787172485cf9ca6c529
parent64a00f7adf5c19be9f800644ac16587dec202e2e
bits: add --fail-width option to reject out-of-range CPU numbers

By default, cpulist_parse() silently ignores values wider than the
cpuset size (fail=0).  The new -f/--fail-width flag switches to fail=1,
causing bits to error out with "bit list wider than cpuset size" when
any CPU number exceeds the --width limit.

Signed-off-by: WanBingjiang <wanbingjiang@webray.com.cn>
bash-completion/bits
tests/expected/bits/bits-fail-width [new file with mode: 0644]
tests/expected/bits/bits-fail-width.err [new file with mode: 0644]
tests/expected/bits/bits-fail-width.exit_code [new file with mode: 0644]
tests/expected/bits/bits-truncate
tests/expected/bits/bits-truncate.err
tests/expected/bits/bits-truncate.exit_code
tests/ts/bits/bits
text-utils/bits.1.adoc
text-utils/bits.c