summaryrefslogtreecommitdiffstats
path: root/hcid
diff options
context:
space:
mode:
Diffstat (limited to 'hcid')
-rw-r--r--hcid/plugin.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/hcid/plugin.c b/hcid/plugin.c
index 2a15741e..847bf5e6 100644
--- a/hcid/plugin.c
+++ b/hcid/plugin.c
@@ -46,6 +46,9 @@ static gboolean add_plugin(GModule *module, struct bluetooth_plugin_desc *desc)
{
struct bluetooth_plugin *plugin;
+ if (desc->init() < 0)
+ return FALSE;
+
plugin = g_try_new0(struct bluetooth_plugin, 1);
if (plugin == NULL)
return FALSE;
@@ -55,8 +58,6 @@ static gboolean add_plugin(GModule *module, struct bluetooth_plugin_desc *desc)
plugins = g_slist_append(plugins, plugin);
- desc->init();
-
return TRUE;
}
@@ -113,8 +114,10 @@ gboolean plugin_init(void)
continue;
}
- if (add_plugin(module, desc) == FALSE)
+ if (add_plugin(module, desc) == FALSE) {
+ error("Can't init plugin %s", g_module_name(module));
g_module_close(module);
+ }
}
g_dir_close(dir);