projects
/
connman
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Release 0.7
[connman]
/
src
/
plugin.c
diff --git
a/src/plugin.c
b/src/plugin.c
index
cfbd906
..
7fb7d44
100644
(file)
--- a/
src/plugin.c
+++ b/
src/plugin.c
@@
-2,7
+2,7
@@
*
* Connection Manager
*
*
* Connection Manager
*
- * Copyright (C) 2007-2008 Intel Corporation. All rights reserved.
+ * Copyright (C) 2007-2009 Intel Corporation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
@@
-40,6
+40,12
@@
static gboolean add_plugin(void *handle, struct connman_plugin_desc *desc)
{
struct connman_plugin *plugin;
{
struct connman_plugin *plugin;
+ if (desc->init == NULL)
+ return FALSE;
+
+ if (g_str_equal(desc->version, CONNMAN_VERSION) == FALSE)
+ return FALSE;
+
plugin = g_try_new0(struct connman_plugin, 1);
if (plugin == NULL)
return FALSE;
plugin = g_try_new0(struct connman_plugin, 1);
if (plugin == NULL)
return FALSE;
@@
-47,15
+53,17
@@
static gboolean add_plugin(void *handle, struct connman_plugin_desc *desc)
plugin->handle = handle;
plugin->desc = desc;
plugin->handle = handle;
plugin->desc = desc;
- if (desc->init() < 0)
+ if (desc->init() < 0) {
+ g_free(plugin);
return FALSE;
return FALSE;
+ }
plugins = g_slist_append(plugins, plugin);
return TRUE;
}
plugins = g_slist_append(plugins, plugin);
return TRUE;
}
-int __connman_plugin_init(void)
+int __connman_plugin_init(const char *pattern)
{
GDir *dir;
const gchar *file;
{
GDir *dir;
const gchar *file;
@@
-92,7
+100,9
@@
int __connman_plugin_init(void)
continue;
}
continue;
}
- if (desc->init == NULL) {
+ if (pattern != NULL && g_pattern_match_simple(pattern,
+ desc->name) == FALSE) {
+ DBG("ignoring %s", desc->description);
dlclose(handle);
continue;
}
dlclose(handle);
continue;
}