From: Felix Fietkau Date: Sun, 22 Jan 2017 13:28:47 +0000 (+0100) Subject: libubus: move uloop_init() call to ubus_connect_ctx X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=cd82f9758dd6da37fb11f2992ceb66d3ee99bac0;p=oweals%2Fubus.git libubus: move uloop_init() call to ubus_connect_ctx uloop should not be used before it is initialized Signed-off-by: Felix Fietkau --- diff --git a/libubus-req.c b/libubus-req.c index 3eeae40..5dcd470 100644 --- a/libubus-req.c +++ b/libubus-req.c @@ -145,7 +145,6 @@ int ubus_complete_request(struct ubus_context *ctx, struct ubus_request *req, int64_t timeout = 0, time_end = 0; if (!registered) { - uloop_init(); ubus_add_uloop(ctx); } diff --git a/libubus.c b/libubus.c index 51a1483..9463522 100644 --- a/libubus.c +++ b/libubus.c @@ -277,6 +277,7 @@ static void ubus_default_connection_lost(struct ubus_context *ctx) int ubus_connect_ctx(struct ubus_context *ctx, const char *path) { + uloop_init(); memset(ctx, 0, sizeof(*ctx)); ctx->sock.fd = -1;