mirror of
git://git.sv.gnu.org/coreutils.git
synced 2026-02-10 17:31:56 +02:00
cksum: promptly diagnose write errors
* src/cksum.c (output_file, digest_check): Check if standard output has it's error flag set after printing. * tests/misc/write-errors.sh: Add a test case that would previously run forever. * NEWS: Mention the improvement. Reorder alphabetically.
This commit is contained in:
6
NEWS
6
NEWS
@@ -73,14 +73,14 @@ GNU coreutils NEWS -*- outline -*-
|
||||
'cksum' now validates its options more consistently.
|
||||
E.g., `cksum --text --tag` now fails like `cksum --tag --text` already did.
|
||||
|
||||
'cksum', 'du', and 'wc' now exit promptly upon receiving a write
|
||||
error, which is significant when processing many input files.
|
||||
|
||||
csplit, ls, and sort, now handle a more complete set of terminating signals.
|
||||
|
||||
'du' now processes directories with 10,000 or more entries up to 9 times
|
||||
faster on the Lustre file system.
|
||||
|
||||
'du', and 'wc' now exit promptly upon receiving a write error,
|
||||
which is significant when processing many input files.
|
||||
|
||||
'pinky' will now exit immediately upon receiving a write error, which is
|
||||
significant when reading large plan or project files.
|
||||
|
||||
|
||||
@@ -1266,6 +1266,9 @@ output_file (char const *file, int binary_file, void const *digest,
|
||||
}
|
||||
|
||||
putchar (delim);
|
||||
|
||||
if (ferror (stdout))
|
||||
write_error ();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1447,6 +1450,9 @@ digest_check (char const *checkfile_name)
|
||||
printf (": %s\n", _("OK"));
|
||||
}
|
||||
}
|
||||
|
||||
if (ferror (stdout))
|
||||
write_error ();
|
||||
}
|
||||
}
|
||||
while (!feof (checkfile_stream) && !ferror (checkfile_stream));
|
||||
|
||||
@@ -24,11 +24,14 @@ if ! test -w /dev/full || ! test -c /dev/full; then
|
||||
skip_ '/dev/full is required'
|
||||
fi
|
||||
|
||||
dev_null_hash=$(cksum -a sha3 -l 256 /dev/null) || framework_failure_
|
||||
|
||||
# Writers that may output data indefinitely.
|
||||
# First word in command line is checked against built programs.
|
||||
# Escapes must be double escaped.
|
||||
printf '%s' "\
|
||||
cat /dev/zero
|
||||
cksum --version; yes '${dev_null_hash}' | cksum --check
|
||||
comm -z /dev/zero /dev/zero
|
||||
cut -z -c1- /dev/zero
|
||||
cut -z -f1- /dev/zero
|
||||
|
||||
Reference in New Issue
Block a user