util: Small refactor

Prepare for further changes.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Martin Kletzander <mkletzan@redhat.com>
This commit is contained in:
Andrea Bolognani 2023-04-25 16:11:07 +02:00
parent dcb9ee99f3
commit d92054c867

View File

@ -1743,15 +1743,17 @@ virFindFileInPath(const char *file)
return NULL; return NULL;
path = g_find_program_in_path(file); path = g_find_program_in_path(file);
if (!path)
return NULL;
if (path) {
/* Workaround for a bug in g_find_program_in_path() not returning absolute /* 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 * path as documented. TODO drop it once we require GLib >= 2.69.0
*/ */
return g_canonicalize_filename(path, NULL); return g_canonicalize_filename(path, NULL);
} }
return NULL;
}
static bool useDirOverride; static bool useDirOverride;