[libvirt PATCH 1/5] util: Small refactor

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

 



Prepare for further changes.

Signed-off-by: Andrea Bolognani <abologna@xxxxxxxxxx>
---
 src/util/virfile.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

diff --git a/src/util/virfile.c b/src/util/virfile.c
index 228482e8f8..8e94d19e45 100644
--- a/src/util/virfile.c
+++ b/src/util/virfile.c
@@ -1743,13 +1743,15 @@ virFindFileInPath(const char *file)
         return NULL;
 
     path = g_find_program_in_path(file);
-    if (!path)
-        return NULL;
 
-    /* Workaround for a bug in g_find_program_in_path() not returning absolute
-     * path as documented. TODO drop it once we require GLib >= 2.69.0
-     */
-    return g_canonicalize_filename(path, NULL);
+    if (path) {
+        /* Workaround for a bug in g_find_program_in_path() not returning absolute
+         * path as documented. TODO drop it once we require GLib >= 2.69.0
+         */
+        return g_canonicalize_filename(path, NULL);
+    }
+
+    return NULL;
 }
 
 
-- 
2.40.1




[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