diff options
Diffstat (limited to 'src/sp/protocol/reqrep0/rep.c')
| -rw-r--r-- | src/sp/protocol/reqrep0/rep.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/src/sp/protocol/reqrep0/rep.c b/src/sp/protocol/reqrep0/rep.c index e84440a7..6df65df3 100644 --- a/src/sp/protocol/reqrep0/rep.c +++ b/src/sp/protocol/reqrep0/rep.c @@ -567,20 +567,21 @@ drop: nni_pipe_recv(p->pipe, &p->aio_recv); } -static int +static nng_err rep0_sock_set_max_ttl(void *arg, const void *buf, size_t sz, nni_opt_type t) { rep0_sock *s = arg; int ttl; - int rv; + nng_err rv; - if ((rv = nni_copyin_int(&ttl, buf, sz, 1, NNI_MAX_MAX_TTL, t)) == 0) { + if ((rv = nni_copyin_int(&ttl, buf, sz, 1, NNI_MAX_MAX_TTL, t)) == + NNG_OK) { nni_atomic_set(&s->ttl, ttl); } return (rv); } -static int +static nng_err rep0_sock_get_max_ttl(void *arg, void *buf, size_t *szp, nni_opt_type t) { rep0_sock *s = arg; @@ -588,7 +589,7 @@ rep0_sock_get_max_ttl(void *arg, void *buf, size_t *szp, nni_opt_type t) return (nni_copyout_int(nni_atomic_get(&s->ttl), buf, szp, t)); } -static int +static nng_err rep0_sock_get_sendfd(void *arg, int *fdp) { rep0_sock *s = arg; @@ -596,7 +597,7 @@ rep0_sock_get_sendfd(void *arg, int *fdp) return (nni_pollable_getfd(&s->writable, fdp)); } -static int +static nng_err rep0_sock_get_recvfd(void *arg, int *fdp) { rep0_sock *s = arg; |
