diff options
Diffstat (limited to 'src/filelock.c')
| -rw-r--r-- | src/filelock.c | 3 |
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) | |||
| 339 | { | 339 | { |
| 340 | struct stat st; | 340 | struct stat st; |
| 341 | 341 | ||
| 342 | int r = renameat_noreplace (AT_FDCWD, old, AT_FDCWD, new); | ||
| 343 | if (! (r < 0 && errno == ENOSYS)) | ||
| 344 | return r; | ||
| 342 | if (link (old, new) == 0) | 345 | if (link (old, new) == 0) |
| 343 | return unlink (old) == 0 || errno == ENOENT ? 0 : -1; | 346 | return unlink (old) == 0 || errno == ENOENT ? 0 : -1; |
| 344 | if (errno != ENOSYS && errno != LINKS_MIGHT_NOT_WORK) | 347 | if (errno != ENOSYS && errno != LINKS_MIGHT_NOT_WORK) |