[PATCH 26/75] secret: Drop virAsprintf() and virAsprintfQuiet() retval checking

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



These functions can't fail really. Drop checking of their retval
then.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 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

--
libvir-list mailing list
libvir-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/libvir-list





[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux