import: report error before losing errno

unlink() may change errno, so report the error from rename() first, then
unlink.
This commit is contained in:
Michal Schmidt 2015-11-05 13:44:09 +01:00
parent 4546c34193
commit 5cfab271fe
1 changed files with 2 additions and 1 deletions

View File

@ -335,8 +335,9 @@ static int raw_pull_make_local_copy(RawPull *i) {
r = rename(tp, p);
if (r < 0) {
r = log_error_errno(errno, "Failed to move writable image into place: %m");
unlink(tp);
return log_error_errno(errno, "Failed to move writable image into place: %m");
return r;
}
log_info("Created new local image '%s'.", i->local);