From nobody Tue Apr 30 23:38:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1537445543798529.2006540999978; Thu, 20 Sep 2018 05:12:23 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B987F308ED64; Thu, 20 Sep 2018 12:12:20 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BE23A106A780; Thu, 20 Sep 2018 12:12:19 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 6FE214BB75; Thu, 20 Sep 2018 12:12:18 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w8KCCG9i026861 for ; Thu, 20 Sep 2018 08:12:16 -0400 Received: by smtp.corp.redhat.com (Postfix) id 84689106A788; Thu, 20 Sep 2018 12:12:16 +0000 (UTC) Received: from unknown54ee7586bd10.attlocal.net.com (ovpn-116-55.phx2.redhat.com [10.3.116.55]) by smtp.corp.redhat.com (Postfix) with ESMTP id 34FB0106A784 for ; Thu, 20 Sep 2018 12:12:10 +0000 (UTC) From: John Ferlan To: libvir-list@redhat.com Date: Thu, 20 Sep 2018 08:12:06 -0400 Message-Id: <20180920121206.28008-1-jferlan@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-loop: libvir-list@redhat.com Subject: [libvirt] [PATCH] Remove ignore_value or void from unlink calls X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.44]); Thu, 20 Sep 2018 12:12:22 +0000 (UTC) X-ZohoMail: RDMRC_0 RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" 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 Reviewed-by: Erik Skultety --- 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); } =20 =20 diff --git a/src/nwfilter/nwfilter_dhcpsnoop.c b/src/nwfilter/nwfilter_dhcp= snoop.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); =20 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(virQEMUCapsInitQMPComm= andPtr cmd) cmd->cmd =3D NULL; =20 if (cmd->monpath) - ignore_value(unlink(cmd->monpath)); + unlink(cmd->monpath); =20 virDomainObjEndAPI(&cmd->vm); =20 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 backen= d, virErrorPtr orig_err =3D virSaveLastError(); =20 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 =3D false; } =20 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, =20 if (!cache->handlers.isValid(loadData, cache->priv)) { VIR_DEBUG("Outdated cached capabilities '%s' for '%s'", file, name= ); - ignore_value(unlink(file)); + unlink(file); ret =3D 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, } =20 /* we won't need the file again */ - ignore_value(unlink(filePath)); + unlink(filePath); =20 ret =3D 0; cleanup: --=20 2.17.1 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list