[OpenWrt-Devel] [PATCH] ubox: exit(1) in logd if registering log object with ubus fails

Alexandru Ardelean ardeleanalex at gmail.com
Fri Aug 8 04:48:52 EDT 2014


From: Alexandru Ardelean <ardeleanalex at gmail.com>

Signed-off-by: Alexandru Ardelean <ardeleanalex at gmail.com>
---
 log/logd.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/log/logd.c b/log/logd.c
index f61e666..a9fec9a 100644
--- a/log/logd.c
+++ b/log/logd.c
@@ -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");
 }
 
-- 
1.8.4.5
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list