Remove ignore_value or void from unlink calls

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@redhat.com>
Reviewed-by: Erik Skultety <eskultet@redhat.com>
This commit is contained in:
John Ferlan 2018-09-20 08:08:19 -04:00
parent 6af8417415
commit e3a42028af
6 changed files with 7 additions and 7 deletions

View File

@ -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);
}

View File

@ -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);

View File

@ -4304,7 +4304,7 @@ virQEMUCapsInitQMPCommandAbort(virQEMUCapsInitQMPCommandPtr cmd)
cmd->cmd = NULL;
if (cmd->monpath)
ignore_value(unlink(cmd->monpath));
unlink(cmd->monpath);
virDomainObjEndAPI(&cmd->vm);

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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: