diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 2 | ||||
-rw-r--r-- | src/plugin.c | 5 | ||||
-rw-r--r-- | src/plugin.h | 5 |
3 files changed, 9 insertions, 3 deletions
@@ -695,7 +695,7 @@ int main(int argc, char *argv[]) umask(0077); - start_logging("bluetoothd", "Bluetooth daemon"); + start_logging("bluetoothd", "Bluetooth daemon %s", VERSION); memset(&sa, 0, sizeof(sa)); sa.sa_flags = SA_NOCLDSTOP; diff --git a/src/plugin.c b/src/plugin.c index 4559c77b..051c33c0 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -53,6 +53,11 @@ static gboolean add_plugin(void *handle, struct bluetooth_plugin_desc *desc) if (desc->init == NULL) return FALSE; + if (g_str_equal(desc->version, VERSION) == FALSE) { + DBG("version mismatch for %s", desc->name); + return FALSE; + } + plugin = g_try_new0(struct bluetooth_plugin, 1); if (plugin == NULL) return FALSE; diff --git a/src/plugin.h b/src/plugin.h index 31bcce87..62d5f758 100644 --- a/src/plugin.h +++ b/src/plugin.h @@ -23,13 +23,14 @@ struct bluetooth_plugin_desc { const char *name; + const char *version; int (*init) (void); void (*exit) (void); }; -#define BLUETOOTH_PLUGIN_DEFINE(name,init,exit) \ +#define BLUETOOTH_PLUGIN_DEFINE(name,version,init,exit) \ extern struct bluetooth_plugin_desc bluetooth_plugin_desc \ __attribute__ ((visibility("default"))); \ struct bluetooth_plugin_desc bluetooth_plugin_desc = { \ - name, init, exit \ + name, version, init, exit \ }; |