util: Don't check the output of virGetUserConfigDirectory()

virGetUserConfigDirectory() *never* *ever* returns NULL, making the
checks for it completely unnecessary.

Signed-off-by: Fabiano Fidêncio <fidencio@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Fabiano Fidêncio 2019-12-19 09:33:54 +01:00
parent 09ae41b88c
commit aa4a0264bf
2 changed files with 1 additions and 4 deletions

View File

@ -66,8 +66,7 @@ virAuthGetConfigFilePathURI(virURIPtr uri,
}
}
if (!(userdir = virGetUserConfigDirectory()))
return -1;
userdir = virGetUserConfigDirectory();
*path = g_strdup_printf("%s/auth.conf", userdir);

View File

@ -1507,8 +1507,6 @@ virConfLoadConfigPath(const char *name)
path = g_strdup_printf("%s/libvirt/%s", SYSCONFDIR, name);
} else {
g_autofree char *userdir = virGetUserConfigDirectory();
if (!userdir)
return NULL;
path = g_strdup_printf("%s/%s", userdir, name);
}