diff options
author | Andrea Bolognani <abologna@redhat.com> | 2023-04-25 16:11:07 +0200 |
---|---|---|
committer | Andrea Bolognani <abologna@redhat.com> | 2023-05-10 18:54:04 +0200 |
commit | d92054c8675df2816fe7c9de87216e494853c276 (patch) | |
tree | 44068d06b7299365cc3acc64e2b6a101e7816539 | |
parent | dcb9ee99f382bdb6476f33a5286cdec0c46c4f1b (diff) | |
download | libvirt-d92054c8675df2816fe7c9de87216e494853c276.tar.gz |
util: Small refactor
Prepare for further changes.
Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
-rw-r--r-- | src/util/virfile.c | 14 |
1 files 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; } |