mirror of
https://https.git.savannah.gnu.org/git/coreutils.git
synced 2026-01-27 01:44:21 +00:00
wc: promptly diagnose write errors
* src/wc.c (write_counts): Call write_error() if any pending errors. * tests/misc/write-errors.sh: Add a test case. * NEWS: Mention the improvement.
This commit is contained in:
parent
b34e329f75
commit
83f274feaa
3
NEWS
3
NEWS
@ -88,6 +88,9 @@ GNU coreutils NEWS -*- outline -*-
|
||||
'timeout' on Linux will always terminate the child in the case where the
|
||||
timeout process itself dies, like when it receives a KILL signal for example.
|
||||
|
||||
'wc' now exits promptly upon receiving a write error,
|
||||
which is significant when processing many input files.
|
||||
|
||||
** Build-related
|
||||
|
||||
'kill' and 'uptime' are no longer built by default. These programs can be
|
||||
|
||||
3
src/wc.c
3
src/wc.c
@ -258,6 +258,9 @@ write_counts (uintmax_t lines,
|
||||
if (file)
|
||||
printf (" %s", strchr (file, '\n') ? quotef (file) : file);
|
||||
putchar ('\n');
|
||||
|
||||
if (ferror (stdout))
|
||||
write_error ();
|
||||
}
|
||||
|
||||
/* Read FD and return a summary. */
|
||||
|
||||
@ -56,6 +56,7 @@ tee < /dev/zero
|
||||
tr . . < /dev/zero
|
||||
unexpand /dev/zero
|
||||
uniq -z -D /dev/zero
|
||||
wc --version; yes /dev/null | tr '\\\\n' '\\\\0' | wc --files0-from=-
|
||||
yes
|
||||
" |
|
||||
sort -k 1b,1 > all_writers || framework_failure_
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user