aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJosé Bollo <jose.bollo@iot.bzh>2016-07-07 17:29:26 +0200
committerJosé Bollo <jose.bollo@iot.bzh>2016-07-07 17:29:26 +0200
commitbca90021828565bddb8624e8f6370bf4959cbfbf (patch)
tree481db0736f9f795c277e3d04ac0fa44b8f04f456
parent836b3c0b74accc5494d7877a22b4a45b5450b6f3 (diff)
Fix bug when logging during bindings init
Change-Id: I1901070c94c3ca7e07b167d7c769d111b02cbd64 Signed-off-by: José Bollo <jose.bollo@iot.bzh>
-rw-r--r--src/afb-api-so.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/afb-api-so.c b/src/afb-api-so.c
index 39a6e9b1..860b097c 100644
--- a/src/afb-api-so.c
+++ b/src/afb-api-so.c
@@ -246,6 +246,8 @@ int afb_api_so_add_binding(const char *path)
void *handle;
struct api_so_desc *desc;
struct afb_binding *(*register_function) (const struct afb_binding_interface *interface);
+ struct afb_verb_desc_v1 fake_verb;
+ struct afb_binding fake_binding;
// This is a loadable library let's check if it's a binding
rc = 0;
@@ -278,6 +280,14 @@ int afb_api_so_add_binding(const char *path)
desc->interface.daemon.itf = &daemon_itf;
desc->interface.daemon.closure = desc;
+ /* for log purpose, a fake binding is needed here */
+ desc->binding = &fake_binding;
+ fake_binding.type = AFB_BINDING_VERSION_1;
+ fake_binding.v1.info = path;
+ fake_binding.v1.prefix = path;
+ fake_binding.v1.verbs = &fake_verb;
+ fake_verb.name = NULL;
+
/* init the binding */
NOTICE("binding [%s] calling registering function %s", path, binding_register_function_v1);
desc->binding = register_function(&desc->interface);