summaryrefslogtreecommitdiffstats
path: root/src/import
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2019-03-27 14:36:36 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2019-03-27 18:09:56 +0100
commit6990fb6bc6f9421a15a3e0b02909b7526cd4cbfc (patch)
treedb2aeb45c8616b52c10f616de5bfc27462add82c /src/import
parentMerge pull request #12119 from keszybz/voidify-mkdir-p (diff)
downloadsystemd-6990fb6bc6f9421a15a3e0b02909b7526cd4cbfc.tar.xz
systemd-6990fb6bc6f9421a15a3e0b02909b7526cd4cbfc.zip
tree-wide: (void)ify a few unlink() and rmdir()
Let's be helpful to static analyzers which care about whether we knowingly ignore return values. We do in these cases, since they are usually part of error paths.
Diffstat (limited to 'src/import')
-rw-r--r--src/import/import-raw.c2
-rw-r--r--src/import/pull-raw.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/import/import-raw.c b/src/import/import-raw.c
index 56f3431a08..b905832603 100644
--- a/src/import/import-raw.c
+++ b/src/import/import-raw.c
@@ -183,7 +183,7 @@ static int raw_import_maybe_convert_qcow2(RawImport *i) {
r = qcow2_convert(i->output_fd, converted_fd);
if (r < 0) {
- unlink(t);
+ (void) unlink(t);
return log_error_errno(r, "Failed to convert qcow2 image: %m");
}
diff --git a/src/import/pull-raw.c b/src/import/pull-raw.c
index 72b9054e49..691de8b275 100644
--- a/src/import/pull-raw.c
+++ b/src/import/pull-raw.c
@@ -250,7 +250,7 @@ static int raw_pull_maybe_convert_qcow2(RawPull *i) {
r = qcow2_convert(i->raw_job->disk_fd, converted_fd);
if (r < 0) {
- unlink(t);
+ (void) unlink(t);
return log_error_errno(r, "Failed to convert qcow2 image: %m");
}
@@ -364,7 +364,7 @@ static int raw_pull_make_local_copy(RawPull *i) {
r = copy_bytes(i->raw_job->disk_fd, dfd, (uint64_t) -1, COPY_REFLINK);
if (r < 0) {
- unlink(tp);
+ (void) unlink(tp);
return log_error_errno(r, "Failed to make writable copy of image: %m");
}
@@ -376,7 +376,7 @@ 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);
+ (void) unlink(tp);
return r;
}