[libvirt] [PATCH 08/42] storage: Don't check the output of virGetUserConfigDirectory()

Ján Tomko jtomko at redhat.com
Thu Dec 19 16:50:49 UTC 2019


On Thu, Dec 19, 2019 at 11:04:13AM +0100, Fabiano Fidêncio wrote:
>virGetUserConfigDirectory() *never* *ever* returns NULL, making the
>checks for it completely unnecessary.
>
>Signed-off-by: Fabiano Fidêncio <fidencio at redhat.com>
>---
> src/storage/storage_driver.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/src/storage/storage_driver.c b/src/storage/storage_driver.c
>index 580a5e6f15..71078dfbd6 100644
>--- a/src/storage/storage_driver.c
>+++ b/src/storage/storage_driver.c
>@@ -278,7 +278,7 @@ storageStateInitialize(bool privileged,
>     } else {
>         configdir = virGetUserConfigDirectory();
>         rundir = virGetUserRuntimeDirectory();
>-        if (!(configdir && rundir))
>+        if (!rundir)
>             goto error;
>

Looking at virGetUserRuntimeDirectory, that one should always return as
well, so you can delete them both (adjusting the commit message)

Reviewed-by: Ján Tomko <jtomko at redhat.com>

Jano
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20191219/274c5881/attachment-0001.sig>


More information about the libvir-list mailing list