struct json_object *result;
struct json_object *obj;
struct afb_export *iter;
+ char *path;
/* clone the globals */
if (json_object_object_get_ex(configuration, "*", &obj))
/* add library path */
for (iter = export ; iter && !iter->path ; iter = iter->creator);
- if (iter)
- json_object_object_add(result, "binding-path", json_object_new_string(iter->path));
+ if (iter) {
+ path = realpath(iter->path, NULL);
+ json_object_object_add(result, "binding-path", json_object_new_string(path));
+ free(path);
+ }
export->settings = result;
return result;
/* search the handler */
handler = export->event_handlers;
while (handler) {
- if (fnmatch(handler->pattern, event, 0)) {
+ if (!fnmatch(handler->pattern, event, 0)) {
if (!(export->hooksvc & afb_hook_flag_api_on_event_handler))
handler->callback(handler->closure, event, object, to_api_x3(export));
else {