[PATCH 30/42] node_device: 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/node_device/node_device_hal.c  | 3 +--
 src/node_device/node_device_udev.c | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/node_device/node_device_hal.c b/src/node_device/node_device_hal.c
index b40f93df46..cf12854fe9 100644
--- a/src/node_device/node_device_hal.c
+++ b/src/node_device/node_device_hal.c
@@ -618,8 +618,7 @@ nodeStateInitialize(bool privileged G_GNUC_UNUSED,
     } else {
         g_autofree char *rundir = NULL;
 
-        if (!(rundir = virGetUserRuntimeDirectory()))
-            goto failure;
+        rundir = virGetUserRuntimeDirectory();
         driver->stateDir = g_strdup_printf("%s/nodedev/run", rundir);
     }
 
diff --git a/src/node_device/node_device_udev.c b/src/node_device/node_device_udev.c
index cae00dc9dc..eedcd123a3 100644
--- a/src/node_device/node_device_udev.c
+++ b/src/node_device/node_device_udev.c
@@ -1806,8 +1806,7 @@ nodeStateInitialize(bool privileged,
     } else {
         g_autofree char *rundir = NULL;
 
-        if (!(rundir = virGetUserRuntimeDirectory()))
-            goto cleanup;
+        rundir = virGetUserRuntimeDirectory();
         driver->stateDir = g_strdup_printf("%s/nodedev/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