]> git.ipfire.org Git - thirdparty/util-linux.git/commit
exch: fix compile error if renameat2 is not present
authorThomas Devoogdt <thomas.devoogdt@barco.com>
Thu, 6 Mar 2025 13:18:48 +0000 (14:18 +0100)
committerThomas Devoogdt <thomas.devoogdt@barco.com>
Fri, 7 Mar 2025 14:03:28 +0000 (15:03 +0100)
commit72a99516f7bdf72411501d0a04cc8f8a7e562d10
treef99bd3bef97787ea0a2b274fb2b2b143b79daf51
parentfe3f80038d128e42536fee323b0bc07ffb766bd5
exch: fix compile error if renameat2 is not present

https://www.man7.org/linux/man-pages/man2/rename.2.html
Available since Linux 3.15 or glibc 2.28,
add a fallback for older systems.

My initial implementation did the exchange using a swap
file if both HAVE_RENAMEAT2 and SYS_renameat2 were absent.
But that is not really what is desired since exch is supposed
to be atomic. So simply return -1 renameat2 is available.

Signed-off-by: Thomas Devoogdt <thomas.devoogdt@barco.com>
misc-utils/exch.c