]> git.ipfire.org Git - thirdparty/coreutils.git/commit
mv: improve -n atomicity
authorPaul Eggert <eggert@cs.ucla.edu>
Wed, 10 Jan 2018 08:48:51 +0000 (00:48 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Wed, 10 Jan 2018 08:51:54 +0000 (00:51 -0800)
commit29baf25aa02d95c832a1258a71cbd2b8d25f5d09
tree16e5c1616cdd8c46dbdb261e4b1c4f03486742ea
parentbc2fd9796403e03bb757b064d44c22fab92e6842
mv: improve -n atomicity

Problem reported by Kamil Dudka (Bug#29961).
* NEWS: Mention this.
* src/copy.c: Include renameat2.h.
(copy_internal): If mv, try renameat2 first thing, with
RENAME_NOREPLACE.  If this works, skip most of the remaining code.
Also, fail quickly if it fails with EEXIST, and we are using -n.
NEWS
src/copy.c