cp: avoid needless unlinkat after fstatat ELOOP
commit3cff27ddc1acf57e5da8b9e8b8c887bfd070b2c0
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 8 Sep 2023 16:14:06 +0000 (8 09:14 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 8 Sep 2023 23:25:39 +0000 (8 16:25 -0700)
tree05a6bf9c10830aa39e6519bea5123ac6c855c9e6
parenta66a4b77a558c340a925e6492cf3acd5cd643445
cp: avoid needless unlinkat after fstatat ELOOP

* src/copy.c (copy_internal): When cp -f's fstatat fails on the
destination with ELOOP, report an error immediately when fstatat
used AT_SYMLINK_NOFOLLOW, as the later unlinkat would fail too.
src/copy.c