service: do not emit any service events before the ubus connection is up
authorFelix Fietkau <nbd@openwrt.org>
Thu, 5 Jun 2014 14:53:29 +0000 (16:53 +0200)
committerFelix Fietkau <nbd@openwrt.org>
Thu, 5 Jun 2014 14:53:29 +0000 (16:53 +0200)
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
service/service.c

index 6426929..74feded 100644 (file)
@@ -453,6 +453,9 @@ service_start_early(char *name, char *cmdline)
 
 void service_event(const char *type, const char *service, const char *instance)
 {
 
 void service_event(const char *type, const char *service, const char *instance)
 {
+       if (!ctx)
+               return;
+
        blob_buf_init(&b, 0);
        blobmsg_add_string(&b, "service", service);
        if (instance)
        blob_buf_init(&b, 0);
        blobmsg_add_string(&b, "service", service);
        if (instance)