Commit Graph
31243 Commits
Author SHA1 Message Date
Collin Funk 803bfa01e1 stat: don't check QUOTING_STYLE when --printf %%N is used
* NEWS: Mention the fix.
* src/stat.c (main): Only check QUOTING_STYLE if there is a %N that is
not preceded by a percentage sign.
* tests/stat/stat-fmt.sh: Add some test cases.
2026-02-26 21:20:37 -08:00
Collin Funk 4195e36664 id: promptly diagnose write errors
* NEWS: Mention the improvement.
* src/id.c (print_stuff): Call fflush for each listed user to check for
write errors.
* tests/misc/io-errors.sh: Add an invocation of 'id'.
2026-02-26 19:07:21 -08:00
Collin Funk 80b229be71 groups: promptly diagnose write errors
* NEWS: Mention the improvement.
* src/groups.c (main): Call fflush for each listed user to check for
write errors.
* tests/misc/io-errors.sh: Add an invocation of 'groups'.
2026-02-26 19:05:32 -08:00
Pádraig Brady 224588ce47 tests: ensure failure to write warnings is handled gracefully
* tests/misc/warning-errors.sh: Add a new test to ensure
failure to write warnings is diagnosed in the exit status.
* tests/local.mk: Reference the new test.
2026-02-26 20:13:41 +00:00
oech3 ba0a1dc28e tests: shuf: ensure randomization doesn't depend solely on ASLR
* tests/shuf/shuf.sh: Use setarch --addr-no-randomize to disable
ASLR, and show the output is still random.
https://github.com/coreutils/coreutils/pull/198
2026-02-26 15:55:07 +00:00
Pádraig Brady 724253d9b7 maint: fix description of tests/misc/io-errors.sh
* tests/misc/io-errors.sh: Promptness is checked in
write-errors.sh, not this test.
2026-02-26 12:47:34 +00:00
oech3 d0a2b73c3c tests: nice: ensure a particular adjustment is disallowed
* tests/nice/nice-fail.sh: Ensure "1+2-3" is disallowed.
https://github.com/coreutils/coreutils/pull/197
2026-02-25 15:00:46 +00:00
Pádraig Brady f06beebd34 tests: factor,numfmt: verify embedded NUL handling
* tests/factor/factor.pl: Verify that embedded NULs
on stdin terminate the _number_.
* tests/numfmt/numfmt.p: Verify that embedded NULs
on stdin terminate the _line_.
https://github.com/coreutils/coreutils/pull/196
2026-02-25 14:52:57 +00:00
Pádraig Brady 8fab3c6d30 tests: fix "Hangup" termination of non-interactive runs
This avoids the test harness being terminated like:
  make[1]: *** [Makefile:24419: check-recursive] Hangup
  make[3]: *** [Makefile:24668: check-TESTS] Hangup
  make: *** [Makefile:24922: check] Hangup
  make[2]: *** [Makefile:24920: check-am] Hangup
  make[4]: *** [Makefile:24685: tests/misc/usage_vs_refs.log] Error 129
  ...

This happened sometimes when the tests were being run non interactively.
For example when run like:

  setsid make TESTS="tests/timeout/timeout.sh \
   tests/tail/overlay-headers.sh" SUBDIRS=. -j2 check

Note the race window can be made bigger by adding a sleep
after tail is stopped in overlay-headers.sh

The race can trigger the kernel to induce its job control
mechanism to prevent stuck processes.
I.e. where it sends SIGHUP + SIGCONT to a process group
when it determines that group may become orphaned,
and there are stopped processes in that group.

* tests/tail/overlay-headers.sh: Use setsid(1) to keep the stopped
tail process in a separate process group, thus avoiding any kernel
job control protection mechanism.
* tests/timeout/timeout.sh: Use setsid(1) to avoid the kernel
checking the main process group when sleep(1) is reparented.
Fixes https://bugs.gnu.org/80477
2026-02-24 19:25:58 +00:00
Collin Funk 7002e025de doc: tee: avoid the use of gpg cleartext signatures in an example
Cleartext signatures have many gotchas. Therefore, the use of detached
signatures is recommended where possible. See:
<https://gnupg.org/blog/20251226-cleartext-signatures.html>.

* doc/coreutils.texi (tee invocation): Adjust gpg invocation to produce
a detached signature.
2026-02-23 10:35:21 -08:00
oech3 3f07c764b6 tests: whoami, logname: verify error handling
* tests/df/no-mtab-status-masked-proc.sh: Tweak unshare check.
* tests/local.mk: Reference new test.
* tests/misc/user.sh: Add new test using unshare -U, to verify
that whoami and logname diagnose failure correctly.
https://github.com/coreutils/coreutils/pull/195
2026-02-23 13:06:19 +00:00
Collin Funk 6ad189d87b doc: stty: mention the -g does not save the terminal window size
* doc/coreutils.texi (stty invocation): Mention that 'stty -g' does not
save the terminal window size as allowed by POSIX.1-2024.
2026-02-21 23:33:56 -08:00
Collin Funk c057266f15 tests: shuf: check that write errors are promptly diagnosed
* tests/misc/write-errors.sh: Add a shuf invocation that would run
forever if write errors weren't diagnosed.
2026-02-21 20:16:43 -08:00
Collin Funk 89735ea830 shuf: avoid locking standard output when using --input-range
Here is the throughput before this patch:

    # write_permuted_numbers
    $ ./src/shuf-prev -i 0-100000000 | pv -r > /dev/null
    [ 153MiB/s]

    # write_random_numbers
    $ timeout 10 ./src/shuf-prev -i 0-100000 -r | pv -r > /dev/null
    [78.6MiB/s]

Here is the throughput after this patch:

    # write_permuted_numbers
    $ timeout 10 ./src/shuf -i 0-100000000 | pv -r > /dev/null
    [ 308MiB/s]

    # write_random_numbers
    $ timeout 10 ./src/shuf -i 0-100000 -r | pv -r > /dev/null
    [ 196MiB/s]

* NEWS: Mention the performance improvement.
* src/shuf.c (write_permuted_numbers, write_random_numbers): Prefer
fputs and fputc which may be unlocked over printf which locks standard
output.
2026-02-21 19:20:07 -08:00
Collin Funk d233ebd7d9 tests: chmod: test that chmod(2) is always called
* tests/chmod/only-op.sh: New file.
* tests/local.mk (all_test): Add the new test.
2026-02-20 21:37:42 -08:00
Collin Funk 992da4574a maint: printf: prefer static initialization
* src/printf.c (main): Remove unnecessary initialization.
2026-02-19 21:42:35 -08:00
Collin Funk 395fcca795 maint: fmt: prefer static initialization
* src/fmt.c (prefix, max_width): Initialize variables.
(main): Remove unnecessary initializations.
2026-02-19 21:40:44 -08:00
Collin Funk 6bf6d52e54 maint: sort: prefer static initialization
* src/sort.c (main): Remove unnecessary initialization.
2026-02-19 21:37:15 -08:00
Collin Funk 96e39300b1 maint: df: prefer static initialization
* src/df.c (human_output_opts, grand_fsu): Initialize variables.
(main): Remove unnecessary initializations.
2026-02-19 21:34:03 -08:00
Collin Funk a24b3075c3 maint: split: prefer static initialization
* src/split.c (outbase, infile): Initialize variables.
(main): Remove unnecessary initializations.
2026-02-19 21:28:40 -08:00
Collin Funk 26c92a62c6 maint: tail: prefer static initialization
* src/tail.c (count_lines, line_end): Initialize variables.
(main): Remove unnecessary initializations.
2026-02-19 21:24:54 -08:00
Collin Funk cc87809aae maint: csplit: prefer static initialization
* src/csplit.c (prefix, remove_files): Initialize variables.
(main): Remove unnecessary initializations.
2026-02-19 21:22:17 -08:00
Collin Funk dc0baaf4de maint: comm: prefer static initialization
* src/comm.c (only_file_1, only_file_2, both): Initialize variables.
(main): Remove unnecessary initializations.
2026-02-19 21:18:41 -08:00
Collin Funk ecf3f98eec maint: wc: prefer static initialization
* src/wc.c (main): Remove unnecessary initializations.
2026-02-19 21:11:27 -08:00
Collin Funk 85dde4c2d9 maint: tac: prefer static initialization
* src/tac.c (separator, separator_ends_record, sentinel_length):
Initialize variables.
(main): Remove unnecessary initializations.
2026-02-19 21:08:43 -08:00
Collin Funk fea1dcadf6 maint: join: prefer static initialization
* src/join.c (print_pairables): Initialize variable.
(main): Remove unnecessary initializations.
2026-02-19 21:05:11 -08:00
Collin Funk 425dd90b88 maint: cut: prefer static initialization
* src/cut.c (main): Remove unnecessary initializations.
2026-02-19 21:01:10 -08:00
Collin Funk 82a20cd6f2 maint: seq: prefer static initialization
* src/seq.c (separator): Initialize variable.
(main): Remove unnecessary initializations.
2026-02-19 20:53:20 -08:00
Collin Funk ef72d0edd2 maint: paste: prefer static initialization
* src/paste.c (main): Remove unnecessary initializations.
2026-02-19 20:49:40 -08:00
Collin Funk 70e4e2d43a maint: install: prefer static initialization
* src/install.c (main): Remove unnecessary initializations.
2026-02-19 20:45:54 -08:00
Collin Funk beb9392206 maint: chmod: prefer static initialization
* src/chmod.c (main): Remove unnecessary initializations.
2026-02-19 20:39:41 -08:00
Collin Funk 5b29c9c04f maint: head: prefer static initialization
* src/head.c (line_end): Initialize variable.
(main): Remove unnecessary initializations.
2026-02-19 20:36:56 -08:00
Collin Funk 97b7213118 maint: ln: prefer static initialization
* src/ln.c (main): Remove unnecessary initializations.
2026-02-19 20:36:47 -08:00
Collin Funk 4bb3309b72 maint: nl: prefer static initialization
* src/nl.c (main): Remove unnecessary initialization.
2026-02-19 20:36:40 -08:00
Collin Funk 1197e54553 maint: touch: prefer static initialization
* src/touch.c (main): Remove unnecessary initializations.
2026-02-19 20:36:31 -08:00
Collin Funk f009f68e3b maint: fold: prefer static initialization
* src/fold.c (main): Remove unnecessary initializations.
2026-02-19 20:36:08 -08:00
Collin Funk a398d52b65 maint: tee: prefer static initialization
* src/tee.c (main): Remove unnecessary initializations.
2026-02-19 20:35:49 -08:00
Collin Funk 66d34782b9 maint: rmdir: prefer static initialization
* src/rmdir.c (main): Remove unnecessary initialization.
2026-02-19 20:35:35 -08:00
Collin Funk 300ef2e63b maint: tty: prefer static initialization
* src/tty.c (main): Remove unnecessary initialization.
2026-02-19 20:35:19 -08:00
Pádraig Brady 200cc6a598 maint: tests: DRY a recent change
* tests/pwd/pwd-long.sh: Adjust so complicated command is not repeated.
2026-02-19 19:42:14 +00:00
Collin Funk 6a3dde5dd2 wc: add aarch64 Neon optimization for wc -l
Here is an example of the performance improvement:

    $ yes abcdefghijklmnopqrstuvwxyz | head -n 100000000 > input
    $ time ./src/wc-prev -l < input
    100000000

    real	0m0.793s
    user	0m0.630s
    sys	0m0.162s
    $ time ./src/wc -l < input
    100000000

    real	0m0.230s
    user	0m0.065s
    sys	0m0.164s

* NEWS: Mention the performance improvement.
* gnulib: Update to the latest commit.
* configure.ac: Check the the necessary intrinsics and functions.
* src/local.mk (noinst_LIBRARIES) [USE_NEON_WC_LINECOUNT]: Add
src/libwc_neon.a.
(src_libwc_neon_a_SOURCES, wc_neon_ldadd, src_libwc_neon_a_CFLAGS)
[USE_NEON_WC_LINECOUNT]: New variables.
(src_wc_LDADD) [USE_NEON_WC_LINECOUNT]: Add $(wc_neon_ldadd).
* src/wc.c [USE_NEON_WC_LINECOUNT]: Include sys/auxv.h and asm/hwcap.h.
(neon_supported) [USE_NEON_WC_LINECOUNT]: New function.
(wc_lines) [USE_NEON_WC_LINECOUNT]: Use neon_supported and
wc_lines_neon.
* src/wc.h (wc_lines_neon): Add declaration.
* src/wc_neon.c: New file.
* doc/coreutils.texi (Hardware Acceleration): Document the "-ASIMD"
hwcap and the variable used in ./configure to override detection of Neon
instructions.
* tests/wc/wc-cpu.sh: Also add "-ASIMD" to disable the use of Neon
instructions.
2026-02-18 20:09:44 -08:00
Pádraig Brady 5f3a601fbb tests: use system ENOTEMPTY message
* tests/mv/dir2dir.sh: Map system specific messages.
* tests/rm/d-2.sh: Likewise.
2026-02-18 18:31:49 +00:00
Pádraig Brady dd3fd4593d maint: tests: avoid ERANGE specific handling
* tests/fmt/base.pl: Verify ERANGE is diagnosed.
* tests/od/od.pl: Adjust determination of ERANGE.
2026-02-18 18:31:49 +00:00
Pádraig Brady 7d07156e03 maint: tests: avoid ELOOP specific handling
* tests/du/long-sloop.sh: Adjust determination of ELOOP.
2026-02-18 18:31:49 +00:00
Pádraig Brady 448a7dc072 maint: tests: avoid ENOSPC specific handling
* tests/csplit/csplit-io-err.sh: Adjust determination of ENOSPC.
* tests/csplit/split-io-err.sh: Likewise.
* tests/fold/fold-zero-width.sh: Verify full ENOSPC message.
* tests/tac/tac-continue.sh: Likewise.
* tests/misc/io-errors.sh: Likewise.
* tests/misc/write-errors.sh: Likewise.
2026-02-18 18:31:49 +00:00
Pádraig Brady 798f94c828 tests: use system ENOSPC message
* tests/head/head-write-error.sh: Verify ENOSPC is output.
* tests/misc/yes.sh: Likewise.
2026-02-18 18:31:49 +00:00
Pádraig Brady 17fb316388 tests: use system ENOTSUP message
* tests/cp/cp-mv-enotsup-xattr.sh: Don't hardcode "Operation not
supported".
* tests/cp/cp-a-selinux.sh: Likewise.
2026-02-18 18:31:49 +00:00
Pádraig Brady e001f99d1e maint: tests: avoid ENOTSUP specific handling
* tests/mv/mv-exchange.sh: Use ENOTSUP rather than
transforming variations.
2026-02-18 18:31:49 +00:00
Pádraig Brady 5c073ec7c5 tests: use system EACCES message
* tests/chgrp/no-x.sh: Don't harcode "Permission denied".
* tests/chmod/no-x.sh: Likewise.
* tests/du/inacc-dest.sh: Likewise.
* tests/du/no-x.sh: Likewise.
* tests/misc/nohup.sh: Likewise.
* tests/mv/part-fail.sh: Likewise.
* tests/mv/perm-1.sh: Likewise.
* tests/rm/fail-eacces.sh: Likewise.
* tests/rm/rm1.sh: Likewise.
* tests/rm/rm2.sh: Likewise.
* tests/rm/unread2.sh: Likewise.
* tests/rm/unreadable.pl: Likewise.
2026-02-18 18:31:49 +00:00
Pádraig Brady fe997b5f98 maint: tests: avoid AIX specific EACCES handling
* tests/rm/inaccessible.sh: Remove AIX specific handling.
* tests/cp/fail-perm.sh: Likeise.  Also remove confusing
EPERM/HPUX mentions.
* tests/misc/sync.sh: Don't hardcode EISDIR and EACCES.
2026-02-18 18:31:49 +00:00