ubox: exit(1) in logd if registering log object with ubus fails
authorAlexandru Ardelean <ardeleanalex@gmail.com>
Fri, 8 Aug 2014 07:48:52 +0000 (07:48 +0000)
committerJohn Crispin <blogic@openwrt.org>
Tue, 12 Aug 2014 23:35:40 +0000 (01:35 +0200)
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
log/logd.c

index f61e6660fc580a55cda5821bc361a45e2dfc5933..a9fec9ad5cd445532e51c71c96e5009a3d3d140c 100644 (file)
@@ -164,8 +164,10 @@ ubus_connect_handler(struct ubus_context *ctx)
        int ret;
 
        ret = ubus_add_object(ctx, &log_object);
-       if (ret)
+       if (ret) {
                fprintf(stderr, "Failed to add object: %s\n", ubus_strerror(ret));
+               exit(1);
+       }
        fprintf(stderr, "log: connected to ubus\n");
 }