summaryrefslogtreecommitdiff
path: root/src/shared/machine-image.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared/machine-image.c')
-rw-r--r--src/shared/machine-image.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c
index 552847e0f0..00337e7c9f 100644
--- a/src/shared/machine-image.c
+++ b/src/shared/machine-image.c
@@ -440,8 +440,9 @@ int image_rename(Image *i, const char *new_name) {
if (!nn)
return -ENOMEM;
- if (renameat2(AT_FDCWD, i->path, AT_FDCWD, new_path, RENAME_NOREPLACE) < 0)
- return -errno;
+ r = rename_noreplace(AT_FDCWD, i->path, AT_FDCWD, new_path);
+ if (r < 0)
+ return r;
/* Restore the immutable bit, if it was set before */
if (file_attr & FS_IMMUTABLE_FL)