From a38bb31727cacfb4ce3f27cb4cc04fb8e7ba322a Mon Sep 17 00:00:00 2001 From: Simon Kelley Date: Wed, 30 Jun 2021 12:30:15 +0100 Subject: [PATCH] Revert "Treat failure of ubus_add_object() in ubus_init() as retry-able." This reverts commit 8a1ef367e27e570cac40d3b09920a4a60c5f7e0b. --- src/ubus.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/ubus.c b/src/ubus.c index 88172a6..4d63006 100644 --- a/src/ubus.c +++ b/src/ubus.c @@ -104,8 +104,6 @@ static void ubus_disconnect_cb(struct ubus_context *ubus) } } -/* Note that this cannot log, it either returns a fatal error, or NULL. - If daemon->ubus is left as NULL, it will be called again for another try. */ char *ubus_init() { struct ubus_context *ubus = NULL; @@ -119,9 +117,9 @@ char *ubus_init() if (ret) { ubus_destroy(ubus); - return NULL; - } - + return (char *)ubus_strerror(ret); + } + ubus->connection_lost = ubus_disconnect_cb; daemon->ubus = ubus; error_logged = 0;