]> xenbits.xensource.com Git - libvirt.git/commitdiff
Remove ignore_value or void from unlink calls
authorJohn Ferlan <jferlan@redhat.com>
Thu, 20 Sep 2018 12:08:19 +0000 (08:08 -0400)
committerJohn Ferlan <jferlan@redhat.com>
Thu, 20 Sep 2018 17:45:56 +0000 (13:45 -0400)
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>
src/conf/virsecretobj.c
src/nwfilter/nwfilter_dhcpsnoop.c
src/qemu/qemu_capabilities.c
src/storage/storage_driver.c
src/util/virfilecache.c
src/util/virnetdev.c

index 2ff2998c1573db5f24718a69f5577cd10ca21de7..78911c09086dd56ce6c256e6e26f8c8212540d43 100644 (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);
 }
 
 
index 2330ba047928a057eeef92031cd2ddf5bed3bce2..6d114557c71a0bf462f905af72f0dfa0b24c0a90 100644 (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);
 
index 04c2adcfb5b834c70d4bbd219dc1429da62e6f95..394202942f0ab96da8156ffb0e7a97efc5203d23 100644 (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);
 
index bf43d77c8bf8858a016d6e7db802c8683b2077ca..7c22c435842ad7f5d5ba1d3a82fbf8e3a50f5463 100644 (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;
     }
 
index 2927c683581e9cf6dc1ed792c0bfe377a7aa1b83..15c0d99fd9b530548920a80d544334c957742594 100644 (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;
     }
index 39c91313de041ee70d3286a307e1bcdde9a7b1d5..e94960c9da3fe2fa14c7ce155077a019b8f6fdca 100644 (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: