There seems to be no need to add the ignore_value wrapper or
caste with (void) to the unlink() calls, so let's just remove
them. I assume at one point in time Coverity complained. So,
let's just be consistent - those that care to check the return
status can and those that don't can just have the naked unlink.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
As a result of Michal's review comment on my recent storage driver
error path series...
src/conf/virsecretobj.c | 2 +-
src/nwfilter/nwfilter_dhcpsnoop.c | 2 +-
src/qemu/qemu_capabilities.c | 2 +-
src/storage/storage_driver.c | 4 ++--
src/util/virfilecache.c | 2 +-
src/util/virnetdev.c | 2 +-
6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/src/conf/virsecretobj.c b/src/conf/virsecretobj.c
index 2ff2998c15..78911c0908 100644
--- a/src/conf/virsecretobj.c
+++ b/src/conf/virsecretobj.c
@@ -666,7 +666,7 @@ virSecretObjDeleteData(virSecretObjPtr obj)
{
/* The configFile will already be removed, so secret won't be
* loaded again if this fails */
- (void)unlink(obj->base64File);
+ unlink(obj->base64File);
}
diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcpsnoop.c
index 2330ba0479..6d114557c7 100644
--- a/src/nwfilter/nwfilter_dhcpsnoop.c
+++ b/src/nwfilter/nwfilter_dhcpsnoop.c
@@ -1923,7 +1923,7 @@ virNWFilterSnoopLeaseFileRefresh(void)
if (rename(TMPLEASEFILE, LEASEFILE) < 0) {
virReportSystemError(errno, _("rename(\"%s\",
\"%s\")"),
TMPLEASEFILE, LEASEFILE);
- ignore_value(unlink(TMPLEASEFILE));
+ unlink(TMPLEASEFILE);
}
virAtomicIntSet(&virNWFilterSnoopState.wLeases, 0);
diff --git a/src/qemu/qemu_capabilities.c b/src/qemu/qemu_capabilities.c
index 04c2adcfb5..394202942f 100644
--- a/src/qemu/qemu_capabilities.c
+++ b/src/qemu/qemu_capabilities.c
@@ -4304,7 +4304,7 @@ virQEMUCapsInitQMPCommandAbort(virQEMUCapsInitQMPCommandPtr cmd)
cmd->cmd = NULL;
if (cmd->monpath)
- ignore_value(unlink(cmd->monpath));
+ unlink(cmd->monpath);
virDomainObjEndAPI(&cmd->vm);
diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
index bf43d77c8b..7c22c43584 100644
--- a/src/storage/storage_driver.c
+++ b/src/storage/storage_driver.c
@@ -84,7 +84,7 @@ storagePoolRefreshFailCleanup(virStorageBackendPtr backend,
virErrorPtr orig_err = virSaveLastError();
if (stateFile)
- ignore_value(unlink(stateFile));
+ unlink(stateFile);
if (backend->stopPool)
backend->stopPool(obj);
if (orig_err) {
@@ -142,7 +142,7 @@ storagePoolUpdateStateCallback(virStoragePoolObjPtr obj,
virReportError(VIR_ERR_INTERNAL_ERROR,
_("Failed to initialize storage pool '%s':
%s"),
def->name, virGetLastErrorMessage());
- ignore_value(unlink(stateFile));
+ unlink(stateFile);
active = false;
}
diff --git a/src/util/virfilecache.c b/src/util/virfilecache.c
index 2927c68358..15c0d99fd9 100644
--- a/src/util/virfilecache.c
+++ b/src/util/virfilecache.c
@@ -161,7 +161,7 @@ virFileCacheLoad(virFileCachePtr cache,
if (!cache->handlers.isValid(loadData, cache->priv)) {
VIR_DEBUG("Outdated cached capabilities '%s' for '%s'",
file, name);
- ignore_value(unlink(file));
+ unlink(file);
ret = 0;
goto cleanup;
}
diff --git a/src/util/virnetdev.c b/src/util/virnetdev.c
index 39c91313de..e94960c9da 100644
--- a/src/util/virnetdev.c
+++ b/src/util/virnetdev.c
@@ -2161,7 +2161,7 @@ virNetDevReadNetConfig(const char *linkdev, int vf,
}
/* we won't need the file again */
- ignore_value(unlink(filePath));
+ unlink(filePath);
ret = 0;
cleanup:
--
2.17.1
Show replies by date
On Thu, Sep 20, 2018 at 08:12:06AM -0400, John Ferlan wrote:
There seems to be no need to add the ignore_value wrapper or
caste with (void) to the unlink() calls, so let's just remove
them. I assume at one point in time Coverity complained. So,
let's just be consistent - those that care to check the return
status can and those that don't can just have the naked unlink.
Signed-off-by: John Ferlan <jferlan(a)redhat.com>
---
As a result of Michal's review comment on my recent storage driver
error path series...
MinGW is happy, Clang is happy, what more can one wish for?! :)
Reviewed-by: Erik Skultety <eskultet(a)redhat.com>