chiark
/
gitweb
/
~ianmdlvl
/
elogind.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
util: add rename_noreplace
[elogind.git]
/
src
/
shared
/
machine-image.c
diff --git
a/src/shared/machine-image.c
b/src/shared/machine-image.c
index 552847e0f0119890255d3244629dcecd3cbd8d41..00337e7c9fe03a6c208e0e16034d45cc5b9bcc71 100644
(file)
--- 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 (!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)
/* Restore the immutable bit, if it was set before */
if (file_attr & FS_IMMUTABLE_FL)