diff options
author | Daniel Mack <github@zonque.org> | 2015-11-09 21:56:49 +0100 |
---|---|---|
committer | Daniel Mack <github@zonque.org> | 2015-11-09 21:56:49 +0100 |
commit | b0bc8dbd73b7d1f66f01849d89acca59c9fbc699 (patch) | |
tree | cf4ce91cd4a2c4dcf325ee210aa507b4dc5e78bb /src/import/pull-raw.c | |
parent | 70d54fca18f52e20c07f37a6c86133229521ee47 (diff) | |
parent | e1427b138fbf7b7f13bb61187635b882be3ca2b2 (diff) |
Merge pull request #1820 from michich/errno-v2
[v2] treewide: treatment of errno and other cleanups
Diffstat (limited to 'src/import/pull-raw.c')
-rw-r--r-- | src/import/pull-raw.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/import/pull-raw.c b/src/import/pull-raw.c index 394131680d..03bfb51756 100644 --- a/src/import/pull-raw.c +++ b/src/import/pull-raw.c @@ -244,7 +244,7 @@ static int raw_pull_maybe_convert_qcow2(RawPull *i) { r = chattr_fd(converted_fd, FS_NOCOW_FL, FS_NOCOW_FL); if (r < 0) - log_warning_errno(errno, "Failed to set file attributes on %s: %m", t); + log_warning_errno(r, "Failed to set file attributes on %s: %m", t); log_info("Unpacking QCOW2 file."); @@ -320,7 +320,7 @@ static int raw_pull_make_local_copy(RawPull *i) { * writes. */ r = chattr_fd(dfd, FS_NOCOW_FL, FS_NOCOW_FL); if (r < 0) - log_warning_errno(errno, "Failed to set file attributes on %s: %m", tp); + log_warning_errno(r, "Failed to set file attributes on %s: %m", tp); r = copy_bytes(i->raw_job->disk_fd, dfd, (uint64_t) -1, true); if (r < 0) { @@ -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); @@ -511,7 +512,7 @@ static int raw_pull_job_on_open_disk_raw(PullJob *j) { r = chattr_fd(j->disk_fd, FS_NOCOW_FL, FS_NOCOW_FL); if (r < 0) - log_warning_errno(errno, "Failed to set file attributes on %s: %m", i->temp_path); + log_warning_errno(r, "Failed to set file attributes on %s: %m", i->temp_path); return 0; } |