From cd82f9758dd6da37fb11f2992ceb66d3ee99bac0 Mon Sep 17 00:00:00 2001 From: Felix Fietkau Date: Sun, 22 Jan 2017 14:28:47 +0100 Subject: [PATCH] libubus: move uloop_init() call to ubus_connect_ctx uloop should not be used before it is initialized Signed-off-by: Felix Fietkau --- libubus-req.c | 1 - libubus.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-) 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; -- 2.30.2