summaryrefslogtreecommitdiffstats
path: root/tests/misc/write-errors.sh
AgeCommit message (Collapse)AuthorLines
2023-07-17join: promptly diagnose write errorsPádraig Brady-1/+1
* src/join.c (prjoin): Check for write errors after each line. * tests/misc/write-errors.sh: enable the test for join. * NEWS: Mention the improvement.
2023-07-17comm: promptly diagnose write errorsPádraig Brady-1/+1
* src/comm.c (writeline): Simplify by removing the unneeded STREAM parameter. Call write_error() upon ferror(). (compare_files): Adjust to simplified writeline(). * tests/misc/write-errors.sh: Enable comm test. * NEWS: Mention the improvement.
2023-07-17cut: promptly diagnose write errorsPádraig Brady-1/+2
* src/cut.c (cut_bytes): Diagnose errors from fwrite() and putchar(). (cut_fields): Likewise. * tests/misc/write-errors.sh: Enable the test for cut, and augment to cover both cut_bytes() and cut_fields(). * NEWS: Mention the improvement.
2023-07-17uniq: promptly diagnose write errorsPádraig Brady-1/+1
* src/uniq.c (write_line): Check the output from fwrite() immediately. (check_file): Likewise. * tests/misc/write-errors.sh: Enable the test case. * NEWS: Mention the improvement.
2023-07-17od: promptly diagnose write errorsPádraig Brady-1/+1
* src/od.c (dump): Check for write errors after each block written, to exit early even with large / unbounded inputs. * tests/misc/write-errors.sh: enable od check. * NEWS: Mention the improvement. Fixes https://bugs.gnu.org/64540
2023-07-17all: avoid repeated diagnostic upon write errorPádraig Brady-6/+0
* cfg.mk (sc_some_programs_must_avoid_exit_failure): Adjust to avoid false positive. (sc_prohibit_exit_write_error): A new syntax check to prohibit open coding error(..., "write error"); instead directing to use... * src/system.h (write_error): ... a new function to clear stdout errors before we explicitly diagnose a write error and exit. * src/basenc.c: Use write_error() to ensure no repeated diagnostics. * src/cat.c: Likewise. * src/expand.c: Likewise. * src/factor.c: Likewise. * src/paste.c: Likewise. * src/seq.c: Likewise. * src/shuf.c: Likewise. * src/split.c: Likewise. * src/tail.c: Likewise. * src/tr.c: Likewise. * src/unexpand.c: Likewise. * tests/misc/write-errors.sh: Remove TODOs for the fixed utilities: expand, factor, paste, shuf, tr, unexpand.
2023-07-17tests: ensure utilties exit promptly upon write errorPádraig Brady-0/+70
* tests/local.mk: Reference the new test. * tests/misc/write-errors.sh: A new test to ensure utilities exit promptly upon writing to /dev/full.