diff options
Diffstat (limited to 'src/import')
-rw-r--r-- | src/import/import-raw.c | 5 | ||||
-rw-r--r-- | src/import/import-tar.c | 5 | ||||
-rw-r--r-- | src/import/pull-raw.c | 4 | ||||
-rw-r--r-- | src/import/pull-tar.c | 5 |
4 files changed, 11 insertions, 8 deletions
diff --git a/src/import/import-raw.c b/src/import/import-raw.c index 25b52f7cbd..7d1ac2afd7 100644 --- a/src/import/import-raw.c +++ b/src/import/import-raw.c @@ -245,8 +245,9 @@ static int raw_import_finish(RawImport *i) { (void) rm_rf_dangerous(i->final_path, false, true, false); } - if (renameat2(AT_FDCWD, i->temp_path, AT_FDCWD, i->final_path, RENAME_NOREPLACE) < 0) - return log_error_errno(errno, "Failed to move image into place: %m"); + r = rename_noreplace(AT_FDCWD, i->temp_path, AT_FDCWD, i->final_path); + if (r < 0) + return log_error_errno(r, "Failed to move image into place: %m"); free(i->temp_path); i->temp_path = NULL; diff --git a/src/import/import-tar.c b/src/import/import-tar.c index dd95575660..ef2345c7b9 100644 --- a/src/import/import-tar.c +++ b/src/import/import-tar.c @@ -201,8 +201,9 @@ static int tar_import_finish(TarImport *i) { (void) rm_rf_dangerous(i->final_path, false, true, false); } - if (renameat2(AT_FDCWD, i->temp_path, AT_FDCWD, i->final_path, RENAME_NOREPLACE) < 0) - return log_error_errno(errno, "Failed to move image into place: %m"); + r = rename_noreplace(AT_FDCWD, i->temp_path, AT_FDCWD, i->final_path); + if (r < 0) + return log_error_errno(r, "Failed to move image into place: %m"); free(i->temp_path); i->temp_path = NULL; diff --git a/src/import/pull-raw.c b/src/import/pull-raw.c index d1d77d598b..c0c6d57ead 100644 --- a/src/import/pull-raw.c +++ b/src/import/pull-raw.c @@ -384,9 +384,9 @@ static void raw_pull_job_on_finished(PullJob *j) { if (r < 0) goto finish; - r = renameat2(AT_FDCWD, i->temp_path, AT_FDCWD, i->final_path, RENAME_NOREPLACE); + r = rename_noreplace(AT_FDCWD, i->temp_path, AT_FDCWD, i->final_path); if (r < 0) { - r = log_error_errno(errno, "Failed to move RAW file into place: %m"); + log_error_errno(r, "Failed to move RAW file into place: %m"); goto finish; } diff --git a/src/import/pull-tar.c b/src/import/pull-tar.c index 16994e1c24..58cafdd789 100644 --- a/src/import/pull-tar.c +++ b/src/import/pull-tar.c @@ -281,8 +281,9 @@ static void tar_pull_job_on_finished(PullJob *j) { if (r < 0) goto finish; - if (renameat2(AT_FDCWD, i->temp_path, AT_FDCWD, i->final_path, RENAME_NOREPLACE) < 0) { - r = log_error_errno(errno, "Failed to rename to final image name: %m"); + r = rename_noreplace(AT_FDCWD, i->temp_path, AT_FDCWD, i->final_path); + if (r < 0) { + log_error_errno(r, "Failed to rename to final image name: %m"); goto finish; } |