mirror of
https://github.com/systemd/systemd.git
synced 2025-01-11 09:18:07 +03:00
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);
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user