From a6f1c53de257f8f857bbadbcc9a2598e33a50637 Mon Sep 17 00:00:00 2001 From: Jakob Olsson <jakob.olsson@iopsys.eu> Date: Thu, 30 Sep 2021 16:11:12 +0200 Subject: [PATCH] map-controller: fix commit before exit --- src/core/cntlr_map.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/core/cntlr_map.c b/src/core/cntlr_map.c index 9fa81a59..9730a1ad 100644 --- a/src/core/cntlr_map.c +++ b/src/core/cntlr_map.c @@ -441,7 +441,7 @@ int handle_ap_autoconfig_search(void *cntlr, struct cmdu_buff *rx_cmdu) UCI_TYPE_STRING); ret = ubus_lookup_id(c->ubus_ctx, "uci", &uci_obj); - if (ret) { + if (!ret) { struct blob_buf bb = {0}; blob_buf_init(&bb, 0); @@ -451,12 +451,9 @@ int handle_ap_autoconfig_search(void *cntlr, struct cmdu_buff *rx_cmdu) "commit", bb.head, NULL, NULL, 2 * 1000); - if (ret) { + if (ret) err("Failed to get 'commit' (ret = %d), exit anyway\n", ret); - blob_buf_free(&bb); - exit(0); - } blob_buf_free(&bb); } -- GitLab