These functions can't fail really. Drop checking of their retval
then.
Signed-off-by: Michal Privoznik <mprivozn(a)redhat.com>
---
src/secret/secret_driver.c | 14 ++++----------
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/src/secret/secret_driver.c b/src/secret/secret_driver.c
index 6d2844f3b7..064a02dfdd 100644
--- a/src/secret/secret_driver.c
+++ b/src/secret/secret_driver.c
@@ -469,25 +469,19 @@ secretStateInitialize(bool privileged,
driver->privileged = privileged;
if (privileged) {
- if (virAsprintf(&driver->configDir,
- "%s/libvirt/secrets", SYSCONFDIR) < 0)
- goto error;
- if (virAsprintf(&driver->stateDir,
- "%s/libvirt/secrets", RUNSTATEDIR) < 0)
- goto error;
+ virAsprintf(&driver->configDir, "%s/libvirt/secrets",
SYSCONFDIR);
+ virAsprintf(&driver->stateDir, "%s/libvirt/secrets",
RUNSTATEDIR);
} else {
g_autofree char *rundir = NULL;
g_autofree char *cfgdir = NULL;
if (!(cfgdir = virGetUserConfigDirectory()))
goto error;
- if (virAsprintf(&driver->configDir, "%s/secrets/", cfgdir) <
0)
- goto error;
+ virAsprintf(&driver->configDir, "%s/secrets/", cfgdir);
if (!(rundir = virGetUserRuntimeDirectory()))
goto error;
- if (virAsprintf(&driver->stateDir, "%s/secrets/run", rundir)
< 0)
- goto error;
+ virAsprintf(&driver->stateDir, "%s/secrets/run", rundir);
}
if (virFileMakePathWithMode(driver->configDir, S_IRWXU) < 0) {
--
2.21.0