From 808eb5198dbe7e0fb2f968977419eb492b84de37 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Sun, 14 Apr 2024 15:47:55 -0700 Subject: [PATCH] Announce NNG version in log. --- src/core/init.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/src/core/init.c b/src/core/init.c index 8f2e10566..c7a660b04 100644 --- a/src/core/init.c +++ b/src/core/init.c @@ -9,6 +9,7 @@ // #include "core/nng_impl.h" +#include "nng/nng.h" #include #include @@ -44,6 +45,8 @@ nni_init_helper(void) nni_sp_tran_sys_init(); nni_inited = true; + nng_log_notice( + "NNG-INIT", "NNG library version %s initialized", nng_version()); return (0); } @@ -51,7 +54,12 @@ nni_init_helper(void) int nni_init(void) { - return (nni_plat_init(nni_init_helper)); + int rv; + if ((rv = nni_plat_init(nni_init_helper)) != 0) { + nng_log_err("NNG-INIT", + "NNG library initialization failed: %s", nng_strerror(rv)); + } + return (rv); } // accessing the list of parameters @@ -60,7 +68,7 @@ typedef struct nni_init_param { nng_init_parameter param; uint64_t value; #ifdef NNG_TEST_LIB - uint64_t effective; + uint64_t effective; #endif } nni_init_param; @@ -114,7 +122,7 @@ nni_init_set_effective(nng_init_parameter p, uint64_t value) } } if ((item = NNI_ALLOC_STRUCT(item)) != NULL) { - item->param = p; + item->param = p; item->effective = value; nni_list_append(&nni_init_params, item); } @@ -134,11 +142,10 @@ nni_init_get_effective(nng_init_parameter p) return (item->effective); } } - return ((uint64_t)-1); + return ((uint64_t) -1); } #endif - static void nni_init_params_fini(void) {