aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--docs/ref/api/init.md2
-rw-r--r--include/nng/nng.h2
-rw-r--r--src/core/init.c6
3 files changed, 5 insertions, 5 deletions
diff --git a/docs/ref/api/init.md b/docs/ref/api/init.md
index 6e737cf3..09708d28 100644
--- a/docs/ref/api/init.md
+++ b/docs/ref/api/init.md
@@ -17,7 +17,7 @@ typedef struct {
int16_t num_resolver_threads;
} nng_init_params;
-extern int nng_init(nng_init_parms *params);
+extern nng_err nng_init(nng_init_parms *params);
```
Before using other interfaces in this library, it is necessary to initialize
diff --git a/include/nng/nng.h b/include/nng/nng.h
index 7ad814c4..bec1dd82 100644
--- a/include/nng/nng.h
+++ b/include/nng/nng.h
@@ -1292,7 +1292,7 @@ typedef struct {
// only the first call can contain a non-NULL params. If already
// initialized with non-NULL params, will return NNG_EALREADY.
// Applications should *not* call a matching nng_fini() in that case.
-NNG_DECL int nng_init(nng_init_params *parms);
+NNG_DECL nng_err nng_init(nng_init_params *parms);
// nng_fini is used to terminate the library, freeing certain global resources.
// Each call to nng_fini is paired to a call to nng_init. The last such
diff --git a/src/core/init.c b/src/core/init.c
index 9d9cdf48..974f4f2e 100644
--- a/src/core/init.c
+++ b/src/core/init.c
@@ -1,5 +1,5 @@
//
-// Copyright 2024 Staysail Systems, Inc. <info@staysail.tech>
+// Copyright 2025 Staysail Systems, Inc. <info@staysail.tech>
// Copyright 2018 Capitar IT Group BV <info@capitar.com>
//
// This software is supplied under the terms of the MIT License, a
@@ -49,11 +49,11 @@ static nng_init_params init_params;
unsigned int init_count;
nni_atomic_flag init_busy;
-int
+nng_err
nng_init(nng_init_params *params)
{
nng_init_params zero = { 0 };
- int rv;
+ nng_err rv;
// cheap spin lock
while (nni_atomic_flag_test_and_set(&init_busy)) {