aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2025-01-14 23:12:16 -0800
committerGarrett D'Amore <garrett@damore.org>2025-01-14 23:12:16 -0800
commit8ff8fa5077164f2ec9dd2f02b7f9f5b66f225db6 (patch)
tree82a51f2e7fea44140b31917e9962e30aab5a6116 /src
parent97058f23b30e703df8f8d1a11512000ca6d199fc (diff)
downloadnng-8ff8fa5077164f2ec9dd2f02b7f9f5b66f225db6.tar.gz
nng-8ff8fa5077164f2ec9dd2f02b7f9f5b66f225db6.tar.bz2
nng-8ff8fa5077164f2ec9dd2f02b7f9f5b66f225db6.zip
aio: more nng_err updates
Diffstat (limited to 'src')
-rw-r--r--src/core/aio.c14
-rw-r--r--src/core/aio.h12
-rw-r--r--src/nng.c4
3 files changed, 15 insertions, 15 deletions
diff --git a/src/core/aio.c b/src/core/aio.c
index 81020bbb..128178c8 100644
--- a/src/core/aio.c
+++ b/src/core/aio.c
@@ -124,7 +124,7 @@ nni_aio_fini(nni_aio *aio)
}
}
-int
+nng_err
nni_aio_alloc(nni_aio **aio_p, nni_cb cb, void *arg)
{
nni_aio *aio;
@@ -134,7 +134,7 @@ nni_aio_alloc(nni_aio **aio_p, nni_cb cb, void *arg)
}
nni_aio_init(aio, cb, arg);
*aio_p = aio;
- return (0);
+ return (NNG_OK);
}
void
@@ -154,7 +154,7 @@ nni_aio_reap(nni_aio *aio)
}
}
-int
+nng_err
nni_aio_set_iov(nni_aio *aio, unsigned nio, const nni_iov *iov)
{
@@ -170,7 +170,7 @@ nni_aio_set_iov(nni_aio *aio, unsigned nio, const nni_iov *iov)
}
}
aio->a_nio = nio;
- return (0);
+ return (NNG_OK);
}
// nni_aio_stop cancels any outstanding operation, and waits for the
@@ -602,7 +602,7 @@ nni_aio_expire_loop(void *arg)
for (;;) {
nni_aio *aio;
- int rv;
+ nng_err rv;
nni_time next;
next = q->eq_next;
@@ -884,7 +884,7 @@ nni_aio_sys_fini(void)
nni_aio_expire_q_list = NULL;
}
-int
+nng_err
nni_aio_sys_init(nng_init_params *params)
{
int16_t num_thr;
@@ -912,5 +912,5 @@ nni_aio_sys_init(nng_init_params *params)
nni_aio_expire_q_list[i] = eq;
}
- return (0);
+ return (NNG_OK);
}
diff --git a/src/core/aio.h b/src/core/aio.h
index 25475323..e0b5a388 100644
--- a/src/core/aio.h
+++ b/src/core/aio.h
@@ -1,5 +1,5 @@
//
-// Copyright 2023 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
@@ -37,7 +37,7 @@ extern void nni_aio_reap(nni_aio *);
// is called with the supplied argument when the operation is complete.
// If NULL is supplied for the callback, then nni_aio_wake is used in its
// place, and the aio is used for the argument.
-extern int nni_aio_alloc(nni_aio **, nni_cb, void *arg);
+extern nng_err nni_aio_alloc(nni_aio **, nni_cb, void *arg);
// nni_aio_free frees the aio, releasing resources (locks)
// associated with it. This is safe to call on zeroed memory.
@@ -138,7 +138,7 @@ extern size_t nni_aio_iov_advance(nni_aio *, size_t);
// nni_aio_iov_count returns the number of bytes referenced by the aio iov.
extern size_t nni_aio_iov_count(nni_aio *);
-extern int nni_aio_set_iov(nni_aio *, unsigned, const nni_iov *);
+extern nng_err nni_aio_set_iov(nni_aio *, unsigned, const nni_iov *);
extern void nni_aio_set_timeout(nni_aio *, nng_duration);
extern void nni_aio_set_expire(nni_aio *, nni_time);
@@ -188,9 +188,9 @@ extern void nni_aio_completions_run(nni_aio_completions *);
extern void nni_aio_completions_add(
nni_aio_completions *, nni_aio *, nng_err, size_t);
-extern int nni_aio_sys_init(nng_init_params *);
-extern bool nni_aio_sys_drain(void);
-extern void nni_aio_sys_fini(void);
+extern nng_err nni_aio_sys_init(nng_init_params *);
+extern bool nni_aio_sys_drain(void);
+extern void nni_aio_sys_fini(void);
typedef struct nni_aio_expire_q nni_aio_expire_q;
diff --git a/src/nng.c b/src/nng.c
index 26f45f76..ad9ae0f6 100644
--- a/src/nng.c
+++ b/src/nng.c
@@ -1828,11 +1828,11 @@ nng_msg_set_pipe(nng_msg *msg, nng_pipe p)
nni_msg_set_pipe(msg, p.id);
}
-int
+nng_err
nng_aio_alloc(nng_aio **app, void (*cb)(void *), void *arg)
{
nng_aio *aio;
- int rv;
+ nng_err rv;
if ((rv = nni_aio_alloc(&aio, (nni_cb) cb, arg)) == 0) {
nng_aio_set_timeout(aio, NNG_DURATION_DEFAULT);