]> git.ipfire.org Git - thirdparty/coreutils.git/commit
shred,sort,split: fix ftruncate error reporting
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 15 Dec 2018 20:13:58 +0000 (12:13 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 15 Dec 2018 20:14:49 +0000 (12:14 -0800)
commita6756257efd4fb957e50177b62af094fecef2745
treeac65d5c2e5b750d62a9a26412fcd574dc28cce3b
parent4711c49312d54e84996c13c612f7081c95f821a6
shred,sort,split: fix ftruncate error reporting

Problem reported for split by Scott Worley (Bug#33761):
* src/shred.c (do_wipefd):
Also report an error if ftruncate fails on a shared memory object.
* src/sort.c (get_outstatus): New function.
(stream_open, avoid_trashing_input): Use it.
* src/sort.c (stream_open):
* src/split.c (create):
If ftruncate fails, do not report an error
unless it is a regular file or a shared memory object.
src/shred.c
src/sort.c
src/split.c