summaryrefslogtreecommitdiff
path: root/src/filelock.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/filelock.c')
-rw-r--r--src/filelock.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/filelock.c b/src/filelock.c
index bfa1d63d833..dd8cb28c425 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -339,6 +339,9 @@ rename_lock_file (char const *old, char const *new, bool force)
{
struct stat st;
+ int r = renameat_noreplace (AT_FDCWD, old, AT_FDCWD, new);
+ if (! (r < 0 && errno == ENOSYS))
+ return r;
if (link (old, new) == 0)
return unlink (old) == 0 || errno == ENOENT ? 0 : -1;
if (errno != ENOSYS && errno != LINKS_MIGHT_NOT_WORK)