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,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;
}