Skip to content

Commit

Permalink
fix: call uloop_done after ubus_connect_ctx
Browse files Browse the repository at this point in the history
`uloop_init` called in `ubus_connect_ctx`.

Signed-off-by: Jianhui Zhao <[email protected]>
  • Loading branch information
zhaojh329 committed Nov 1, 2024
1 parent 3b69a48 commit 65befb7
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ubus.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,11 +684,14 @@ static int lua_ubus_connect(lua_State *L)
memset(ctx, 0, sizeof(struct eco_ubus_context));

if (ubus_connect_ctx(&ctx->ctx, path)) {
uloop_done();
lua_pushnil(L);
lua_pushliteral(L, "Failed to connect to ubus");
return 2;
}

uloop_done();

if (path) {
strcpy(ctx->path_data, path);
ctx->path = ctx->path_data;
Expand Down

0 comments on commit 65befb7

Please sign in to comment.