diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-04-27 19:07:03 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-04-27 19:07:05 -0700 |
| commit | c5b07415cc3a6a7960cb3ca2a2aaf70b1cbe3469 (patch) | |
| tree | 7068cd50d8da4a1f492cfc08a25636a43a0cb194 /src/core | |
| parent | 9ebf1b2d2cc4bb850cc152168c08a1bb9e3e8ddb (diff) | |
| download | nng-c5b07415cc3a6a7960cb3ca2a2aaf70b1cbe3469.tar.gz nng-c5b07415cc3a6a7960cb3ca2a2aaf70b1cbe3469.tar.bz2 nng-c5b07415cc3a6a7960cb3ca2a2aaf70b1cbe3469.zip | |
AIO: Use nng_err for cancellation callback instead of int.
This is part of our work to improve type safety/awareness, and also
improve debugger support, for NNG error codes. There are still quite
a few more but this should help.
Diffstat (limited to 'src/core')
| -rw-r--r-- | src/core/aio.c | 2 | ||||
| -rw-r--r-- | src/core/aio.h | 2 | ||||
| -rw-r--r-- | src/core/aio_test.c | 2 | ||||
| -rw-r--r-- | src/core/device.c | 4 | ||||
| -rw-r--r-- | src/core/msgqueue.c | 2 | ||||
| -rw-r--r-- | src/core/sockfd.c | 2 | ||||
| -rw-r--r-- | src/core/tcp.c | 2 |
7 files changed, 8 insertions, 8 deletions
diff --git a/src/core/aio.c b/src/core/aio.c index 9b0fe4d5..4c4c78b6 100644 --- a/src/core/aio.c +++ b/src/core/aio.c @@ -762,7 +762,7 @@ nni_aio_iov_advance(nni_aio *aio, size_t n) } static void -nni_sleep_cancel(nng_aio *aio, void *arg, int rv) +nni_sleep_cancel(nng_aio *aio, void *arg, nng_err rv) { NNI_ARG_UNUSED(arg); nni_aio_expire_q *eq = aio->a_expire_q; diff --git a/src/core/aio.h b/src/core/aio.h index a1b06e1d..5884e253 100644 --- a/src/core/aio.h +++ b/src/core/aio.h @@ -17,7 +17,7 @@ #include "core/taskq.h" #include "core/thread.h" -typedef void (*nni_aio_cancel_fn)(nni_aio *, void *, int); +typedef void (*nni_aio_cancel_fn)(nni_aio *, void *, nng_err); // nni_aio_init initializes an aio object. The callback is called with // the supplied argument when the operation is complete. If NULL is diff --git a/src/core/aio_test.c b/src/core/aio_test.c index 01765dce..99060349 100644 --- a/src/core/aio_test.c +++ b/src/core/aio_test.c @@ -25,7 +25,7 @@ sleep_done(void *arg) } static void -cancel(nng_aio *aio, void *arg, int rv) +cancel(nng_aio *aio, void *arg, nng_err rv) { *(int *) arg = rv; nng_aio_finish(aio, rv); diff --git a/src/core/device.c b/src/core/device.c index 24ba5499..68ab2f38 100644 --- a/src/core/device.c +++ b/src/core/device.c @@ -1,5 +1,5 @@ // -// Copyright 2024 Staysail Systems, Inc. <info@staysail.com> +// Copyright 2025 Staysail Systems, Inc. <info@staysail.com> // Copyright 2018 Capitar IT Group BV <info@capitar.com> // // This software is supplied under the terms of the MIT License, a @@ -60,7 +60,7 @@ device_fini(void *arg) } static void -device_cancel(nni_aio *aio, void *arg, int rv) +device_cancel(nni_aio *aio, void *arg, nng_err rv) { device_data *d = arg; // cancellation is the only path to shutting it down. diff --git a/src/core/msgqueue.c b/src/core/msgqueue.c index f0f2de8b..5d33fd94 100644 --- a/src/core/msgqueue.c +++ b/src/core/msgqueue.c @@ -197,7 +197,7 @@ nni_msgq_run_notify(nni_msgq *mq) } static void -nni_msgq_cancel(nni_aio *aio, void *arg, int rv) +nni_msgq_cancel(nni_aio *aio, void *arg, nng_err rv) { nni_msgq *mq = arg; diff --git a/src/core/sockfd.c b/src/core/sockfd.c index ce0c6772..758cb755 100644 --- a/src/core/sockfd.c +++ b/src/core/sockfd.c @@ -99,7 +99,7 @@ sfd_start_conn(sfd_listener *l, nni_aio *aio) } static void -sfd_cancel_accept(nni_aio *aio, void *arg, int rv) +sfd_cancel_accept(nni_aio *aio, void *arg, nng_err rv) { sfd_listener *l = arg; diff --git a/src/core/tcp.c b/src/core/tcp.c index b0ed75fb..f7a30ed2 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -35,7 +35,7 @@ typedef struct { } tcp_dialer; static void -tcp_dial_cancel(nni_aio *aio, void *arg, int rv) +tcp_dial_cancel(nni_aio *aio, void *arg, nng_err rv) { tcp_dialer *d = arg; |
