trivial: fu-common: fix fallback for esp-path if udisks missing

Fixes: #2803
This commit is contained in:
Mario Limonciello 2021-02-10 10:39:58 -06:00 committed by Mario Limonciello
parent 378b00018b
commit be220a4f56

View File

@ -2772,13 +2772,19 @@ fu_common_get_esp_for_path (const gchar *esp_path, GError **error)
{
g_autofree gchar *basename = NULL;
g_autoptr(GPtrArray) volumes = NULL;
g_autoptr(GError) error_local = NULL;
g_return_val_if_fail (esp_path != NULL, NULL);
g_return_val_if_fail (error == NULL || *error == NULL, NULL);
volumes = fu_common_get_volumes_by_kind (FU_VOLUME_KIND_ESP, error);
if (volumes == NULL)
volumes = fu_common_get_volumes_by_kind (FU_VOLUME_KIND_ESP, &error_local);
if (volumes == NULL) {
/* check if it's a valid directory already */
if (g_file_test (esp_path, G_FILE_TEST_IS_DIR))
return fu_volume_new_from_mount_path (esp_path);
g_propagate_error (error, g_steal_pointer (&error_local));
return NULL;
}
basename = g_path_get_basename (esp_path);
for (guint i = 0; i < volumes->len; i++) {
FuVolume *vol = g_ptr_array_index (volumes, i);