init: reduce delay after starting kmodloader
[project/procd.git] / service / watch.c
index b5f4ae3..349b484 100644 (file)
@@ -26,11 +26,6 @@ struct watch_object {
        char *name;
 };
 
-struct watch_subscribe {
-       struct uloop_timeout t;
-       uint32_t id;
-};
-
 static struct ubus_event_handler watch_event;
 static struct ubus_subscriber watch_subscribe;
 static LIST_HEAD(watch_objects);
@@ -117,8 +112,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");
 }