diff options
author | Michal Schmidt <mschmidt@redhat.com> | 2015-11-05 13:44:09 +0100 |
---|---|---|
committer | Michal Schmidt <mschmidt@redhat.com> | 2015-11-05 13:44:09 +0100 |
commit | 5cfab271fe5f60ce211e8755eedb7789a6e150d7 (patch) | |
tree | 309ceaff8e311b825e36d98932f5d145c98ab36f /src | |
parent | 4546c34193064a1536d551facdcb398c0b765175 (diff) | |
download | systemd-5cfab271fe5f60ce211e8755eedb7789a6e150d7.tar.gz |
import: report error before losing errno
unlink() may change errno, so report the error from rename() first, then
unlink.
Diffstat (limited to 'src')
-rw-r--r-- | src/import/pull-raw.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/import/pull-raw.c b/src/import/pull-raw.c index 4c1787b682..03bfb51756 100644 --- a/src/import/pull-raw.c +++ b/src/import/pull-raw.c @@ -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); |