diff options
author | Pádraig Brady <P@draigBrady.com> | 2012-07-01 01:14:42 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2012-07-02 21:14:29 +0200 |
commit | 44fbd3fd862e34d42006f8b74cb11c9c56346417 (patch) | |
tree | 2455d37347b3e504d30c33c607cd1f096c9c51c5 /NEWS | |
parent | 8285c2aca0ee81ca2ce0507084259de8384e809f (diff) | |
download | coreutils-44fbd3fd862e34d42006f8b74cb11c9c56346417.tar.xz |
sort: avoid redundant processing with inaccessible inputs or output
* src/sort.c (check_inputs): A new function to verify all inputs
are accessible before further processing.
(check_output): A new function to open or create a specified
output file, before futher processing.
(stream_open): Adjust to truncating the previously opened
output file rather than opening directly.
(avoid_trashing_input): Optimize to stat the output file
descriptor, rather than the file name.
(main): Call the new functions to check accessibility of
inputs and output, before processing starts.
* tests/misc/sort: Adjust to the changed error message.
* tests/misc/sort-merge-fdlimit: Account for the earlier opened
file descriptor of the specified output file.
* tests/misc/sort-exit-early: A new test to exercise the improvements.
* tests/Makefile.am: Reference the new test.
* NEWS: Mention the improvement.
Suggested-by: Bernhard Voelker
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -41,6 +41,12 @@ GNU coreutils NEWS -*- outline -*- patches as well as enough support to build on the Hurd, we no longer have any reason to include it here. +** Improvements + + sort avoids redundant processing in the presence of inaccessible inputs, + or unwritable output. Sort now diagnoses certain errors at start-up, + rather than after potentially expensive processing. + * Noteworthy changes in release 8.17 (2012-05-10) [stable] |