import: report error before losing errno
unlink() may change errno, so report the error from rename() first, then unlink.
This commit is contained in:
parent
4546c34193
commit
5cfab271fe
|
@ -335,8 +335,9 @@ static int raw_pull_make_local_copy(RawPull *i) {
|
||||||
|
|
||||||
r = rename(tp, p);
|
r = rename(tp, p);
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
|
r = log_error_errno(errno, "Failed to move writable image into place: %m");
|
||||||
unlink(tp);
|
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);
|
log_info("Created new local image '%s'.", i->local);
|
||||||
|
|
Loading…
Reference in a new issue