afb-export: Fix error in event handling 47/18047/1
authorJosé Bollo <jose.bollo@iot.bzh>
Fri, 16 Nov 2018 10:37:54 +0000 (11:37 +0100)
committerJosé Bollo <jose.bollo@iot.bzh>
Fri, 16 Nov 2018 10:40:33 +0000 (11:40 +0100)
Change-Id: I2869a2a840fb07550d493ddc2d651358892d33d1
Signed-off-by: José Bollo <jose.bollo@iot.bzh>
src/afb-export.c

index e679b76..0892177 100644 (file)
@@ -1167,7 +1167,7 @@ static void listener_of_events(void *closure, const char *event, int eventid, st
        /* 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 {