* List of loaded features
*/
linked_list_t *loaded;
+
+ /**
+ * List features failed to load
+ */
+ linked_list_t *failed;
};
/**
dlclose(entry->handle);
}
entry->loaded->destroy(entry->loaded);
+ entry->failed->destroy(entry->failed);
free(entry);
}
INIT(*entry,
.plugin = plugin,
.loaded = linked_list_create(),
+ .failed = linked_list_create(),
);
DBG2(DBG_LIB, "plugin '%s': loaded successfully", name);
return SUCCESS;
}
/**
+ * Check if loading a feature of a plugin failed
+ */
+static bool feature_failed(private_plugin_loader_t *this, plugin_entry_t *entry,
+ plugin_feature_t *feature)
+{
+ return entry->failed->find_first(entry->failed, NULL,
+ (void**)&feature) == SUCCESS;
+}
+
+/**
* Check if dependencies are satisfied
*/
static bool dependencies_satisfied(private_plugin_loader_t *this,
{
case FEATURE_PROVIDE:
if (!feature_loaded(this, entry, feature) &&
+ !feature_failed(this, entry, feature) &&
dependencies_satisfied(this, entry, soft, report,
- feature, count - i) &&
- plugin_feature_load(entry->plugin, feature, reg))
+ feature, count - i))
{
- entry->loaded->insert_last(entry->loaded, feature);
- loaded++;
+ if (plugin_feature_load(entry->plugin, feature, reg))
+ {
+ entry->loaded->insert_last(entry->loaded, feature);
+ loaded++;
+ }
+ else
+ {
+ entry->failed->insert_last(entry->failed, feature);
+ }
}
break;
case FEATURE_REGISTER: