[PATCH 40/42] interface: Don't check the output of virGetUserRuntimeDirectory()

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

 



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

Signed-off-by: Fabiano Fidêncio <fidencio@xxxxxxxxxx>
---
 src/interface/interface_backend_netcf.c | 3 +--
 src/interface/interface_backend_udev.c  | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/interface/interface_backend_netcf.c b/src/interface/interface_backend_netcf.c
index 4f46717cf3..65cb7eae62 100644
--- a/src/interface/interface_backend_netcf.c
+++ b/src/interface/interface_backend_netcf.c
@@ -105,8 +105,7 @@ netcfStateInitialize(bool privileged,
     } else {
         g_autofree char *rundir = NULL;
 
-        if (!(rundir = virGetUserRuntimeDirectory()))
-            goto error;
+        rundir = virGetUserRuntimeDirectory();
         driver->stateDir = g_strdup_printf("%s/interface/run", rundir);
     }
 
diff --git a/src/interface/interface_backend_udev.c b/src/interface/interface_backend_udev.c
index 26b1045f8a..7cc098eb33 100644
--- a/src/interface/interface_backend_udev.c
+++ b/src/interface/interface_backend_udev.c
@@ -1160,8 +1160,7 @@ udevStateInitialize(bool privileged,
     } else {
         g_autofree char *rundir = NULL;
 
-        if (!(rundir = virGetUserRuntimeDirectory()))
-            goto cleanup;
+        rundir = virGetUserRuntimeDirectory();
         driver->stateDir = g_strdup_printf("%s/interface/run", rundir);
     }
 
-- 
2.24.1

--
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