summaryrefslogtreecommitdiff
path: root/lib/northbound.c
diff options
context:
space:
mode:
authorIgor Ryzhov <iryzhov@nfware.com>2024-02-26 11:30:57 +0200
committerIgor Ryzhov <iryzhov@nfware.com>2024-02-26 11:30:57 +0200
commit3cd6ddaec6fd41ac84ef23595ffc7e3d18334839 (patch)
tree534070fd00cb53f600a45539db286f0172aee8a1 /lib/northbound.c
parent2bc8ae0d6a6d21e68e07484bc00893d4d9aeb0b7 (diff)
lib: fix setting temporary log options for libyang
By calling `ly_log_options` with `LY_LOSTORE`, the current code effectively disables libyang logging and never enables it back. The call is done to get the current logging options, but we don't really need that. When looking for a schema node, we don't want neither to log nor to store the error, so simply set the temporary options to 0. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
Diffstat (limited to 'lib/northbound.c')
-rw-r--r--lib/northbound.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/northbound.c b/lib/northbound.c
index f9f9449ea6..25ea658bc4 100644
--- a/lib/northbound.c
+++ b/lib/northbound.c
@@ -157,7 +157,7 @@ void nb_nodes_delete(void)
struct nb_node *nb_node_find(const char *path)
{
const struct lysc_node *snode;
- uint32_t llopts;
+ uint32_t llopts = 0;
/*
* Use libyang to find the schema node associated to the path and get
@@ -165,8 +165,6 @@ struct nb_node *nb_node_find(const char *path)
* disable logging temporarily to avoid libyang from logging an error
* message when the node is not found.
*/
- llopts = ly_log_options(LY_LOSTORE);
- llopts &= ~LY_LOLOG;
ly_temp_log_options(&llopts);
snode = yang_find_snode(ly_native_ctx, path, 0);