summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2014-06-05 16:46:32 +0200
committerFelix Fietkau <nbd@openwrt.org>2014-06-05 16:46:32 +0200
commita9ee0b693ebce775ab7a56fd09c92f98076fe559 (patch)
treedea64a01fb7500b582c08870ed7ea02752efe69d
parent919eb0f0f58c36f4b05a11a06f12429a8a863bdf (diff)
downloadunitd-a9ee0b693ebce775ab7a56fd09c92f98076fe559.tar
unitd-a9ee0b693ebce775ab7a56fd09c92f98076fe559.zip
service: register the subscriber object before the event handler
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
-rw-r--r--service/watch.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/service/watch.c b/service/watch.c
index b5f4ae3..65e1fec 100644
--- a/service/watch.c
+++ b/service/watch.c
@@ -117,8 +117,8 @@ watch_ubus(struct ubus_context *ctx)
{
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_event_handler(ctx, &watch_event, "ubus.object.add"))
+ ERROR("failed to add ubus event handler\n");
}