aboutsummaryrefslogtreecommitdiff
path: root/src/platform/posix/posix_tcpdial.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/platform/posix/posix_tcpdial.c')
-rw-r--r--src/platform/posix/posix_tcpdial.c28
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[] = {