summaryrefslogtreecommitdiff
path: root/src/import/pull-raw.c
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2015-11-05 13:44:09 +0100
committerMichal Schmidt <mschmidt@redhat.com>2015-11-05 13:44:09 +0100
commit5cfab271fe5f60ce211e8755eedb7789a6e150d7 (patch)
tree309ceaff8e311b825e36d98932f5d145c98ab36f /src/import/pull-raw.c
parent4546c34193064a1536d551facdcb398c0b765175 (diff)
import: report error before losing errno
unlink() may change errno, so report the error from rename() first, then unlink.
Diffstat (limited to 'src/import/pull-raw.c')
-rw-r--r--src/import/pull-raw.c3
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);