projects
/
project
/
procd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
service: register the subscriber object before the event handler
[project/procd.git]
/
service
/
watch.c
diff --git
a/service/watch.c
b/service/watch.c
index
0d2d9e0
..
65e1fec
100644
(file)
--- a/
service/watch.c
+++ b/
service/watch.c
@@
-65,7
+65,7
@@
static void watch_subscribe_cb(struct ubus_context *ctx, struct ubus_event_handl
continue;
if (!ubus_subscribe(ctx, &watch_subscribe, id))
return;
continue;
if (!ubus_subscribe(ctx, &watch_subscribe, id))
return;
- ERROR("failed to suscribe %d\n", id);
+ ERROR("failed to su
b
scribe %d\n", id);
}
}
}
}
@@
-117,8
+117,8
@@
watch_ubus(struct ubus_context *ctx)
{
watch_event.cb = watch_subscribe_cb;
watch_subscribe.cb = watch_notify_cb;
{
watch_event.cb = watch_subscribe_cb;
watch_subscribe.cb = watch_notify_cb;
- if (ubus_register_event_handler(ctx, &watch_event, "ubus.object.add"))
- ERROR("failed to add ubus event handler\n");
if (ubus_register_subscriber(ctx, &watch_subscribe))
ERROR("failed to register ubus subscriber\n");
if (ubus_register_subscriber(ctx, &watch_subscribe))
ERROR("failed to register ubus subscriber\n");
+ if (ubus_register_event_handler(ctx, &watch_event, "ubus.object.add"))
+ ERROR("failed to add ubus event handler\n");
}
}