diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-04-27 23:35:25 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-04-27 23:35:25 -0700 |
| commit | 7bb5ab9c4f70c9fa0a67a22c4aee83b0109318c4 (patch) | |
| tree | 5a3036d609404ee5218b6189a89799e70f4623df /src/platform/posix/posix_tcpdial.c | |
| parent | 70ae513e4dda50864f7d45b6676549ed5246144d (diff) | |
| download | nng-7bb5ab9c4f70c9fa0a67a22c4aee83b0109318c4.tar.gz nng-7bb5ab9c4f70c9fa0a67a22c4aee83b0109318c4.tar.bz2 nng-7bb5ab9c4f70c9fa0a67a22c4aee83b0109318c4.zip | |
Converted property functions to use nng_err.
Diffstat (limited to 'src/platform/posix/posix_tcpdial.c')
| -rw-r--r-- | src/platform/posix/posix_tcpdial.c | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/src/platform/posix/posix_tcpdial.c b/src/platform/posix/posix_tcpdial.c index 52807892..181a667f 100644 --- a/src/platform/posix/posix_tcpdial.c +++ b/src/platform/posix/posix_tcpdial.c @@ -280,14 +280,15 @@ error: nni_aio_finish_error(aio, rv); } -static int +static nng_err tcp_dialer_set_nodelay(void *arg, const void *buf, size_t sz, nni_type t) { nni_tcp_dialer *d = arg; - int rv; + nng_err rv; bool b; - if (((rv = nni_copyin_bool(&b, buf, sz, t)) != 0) || (d == NULL)) { + if (((rv = nni_copyin_bool(&b, buf, sz, t)) != NNG_OK) || + (d == NULL)) { return (rv); } nni_mtx_lock(&d->mtx); @@ -296,7 +297,7 @@ tcp_dialer_set_nodelay(void *arg, const void *buf, size_t sz, nni_type t) return (0); } -static int +static nng_err tcp_dialer_get_nodelay(void *arg, void *buf, size_t *szp, nni_type t) { bool b; @@ -307,14 +308,15 @@ tcp_dialer_get_nodelay(void *arg, void *buf, size_t *szp, nni_type t) return (nni_copyout_bool(b, buf, szp, t)); } -static int +static nng_err tcp_dialer_set_keepalive(void *arg, const void *buf, size_t sz, nni_type t) { nni_tcp_dialer *d = arg; - int rv; + nng_err rv; bool b; - if (((rv = nni_copyin_bool(&b, buf, sz, t)) != 0) || (d == NULL)) { + if (((rv = nni_copyin_bool(&b, buf, sz, t)) != NNG_OK) || + (d == NULL)) { return (rv); } nni_mtx_lock(&d->mtx); @@ -323,7 +325,7 @@ tcp_dialer_set_keepalive(void *arg, const void *buf, size_t sz, nni_type t) return (0); } -static int +static nng_err tcp_dialer_get_keepalive(void *arg, void *buf, size_t *szp, nni_type t) { bool b; @@ -334,7 +336,7 @@ tcp_dialer_get_keepalive(void *arg, void *buf, size_t *szp, nni_type t) return (nni_copyout_bool(b, buf, szp, t)); } -static int +static nng_err tcp_dialer_get_locaddr(void *arg, void *buf, size_t *szp, nni_type t) { nni_tcp_dialer *d = arg; @@ -348,7 +350,7 @@ tcp_dialer_get_locaddr(void *arg, void *buf, size_t *szp, nni_type t) return (nni_copyout_sockaddr(&sa, buf, szp, t)); } -static int +static nng_err tcp_dialer_set_locaddr(void *arg, const void *buf, size_t sz, nni_type t) { nni_tcp_dialer *d = arg; @@ -356,13 +358,13 @@ tcp_dialer_set_locaddr(void *arg, const void *buf, size_t sz, nni_type t) struct sockaddr_storage ss; struct sockaddr_in *sin; size_t len; - int rv; + nng_err rv; #ifdef NNG_ENABLE_IPV6 struct sockaddr_in6 *sin6; #endif NNI_ARG_UNUSED(sz); - if ((rv = nni_copyin_sockaddr(&sa, buf, t)) != 0) { + if ((rv = nni_copyin_sockaddr(&sa, buf, t)) != NNG_OK) { return (rv); } if ((len = nni_posix_nn2sockaddr(&ss, &sa)) == 0) { @@ -400,7 +402,7 @@ tcp_dialer_set_locaddr(void *arg, const void *buf, size_t sz, nni_type t) d->srclen = len; nni_mtx_unlock(&d->mtx); } - return (0); + return (NNG_OK); } static const nni_option tcp_dialer_options[] = { |
