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/core/socket.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/core/socket.c')
| -rw-r--r-- | src/core/socket.c | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/src/core/socket.c b/src/core/socket.c index 0dfdb183..0e2e72ea 100644 --- a/src/core/socket.c +++ b/src/core/socket.c @@ -153,80 +153,80 @@ sock_get_fd(nni_sock *s, unsigned flag, int *fdp) return (rv); } -static int +static nng_err sock_set_recvtimeo(void *s, const void *buf, size_t sz, nni_type t) { return (nni_copyin_ms(&SOCK(s)->s_rcvtimeo, buf, sz, t)); } -static int +static nng_err sock_get_recvtimeo(void *s, void *buf, size_t *szp, nni_type t) { return (nni_copyout_ms(SOCK(s)->s_rcvtimeo, buf, szp, t)); } -static int +static nng_err sock_set_sendtimeo(void *s, const void *buf, size_t sz, nni_type t) { return (nni_copyin_ms(&SOCK(s)->s_sndtimeo, buf, sz, t)); } -static int +static nng_err sock_get_sendtimeo(void *s, void *buf, size_t *szp, nni_type t) { return (nni_copyout_ms(SOCK(s)->s_sndtimeo, buf, szp, t)); } -static int +static nng_err sock_set_reconnmint(void *s, const void *buf, size_t sz, nni_type t) { return (nni_copyin_ms(&SOCK(s)->s_reconn, buf, sz, t)); } -static int +static nng_err sock_get_reconnmint(void *s, void *buf, size_t *szp, nni_type t) { return (nni_copyout_ms(SOCK(s)->s_reconn, buf, szp, t)); } -static int +static nng_err sock_set_reconnmaxt(void *s, const void *buf, size_t sz, nni_type t) { return (nni_copyin_ms(&SOCK(s)->s_reconnmax, buf, sz, t)); } -static int +static nng_err sock_get_reconnmaxt(void *s, void *buf, size_t *szp, nni_type t) { return (nni_copyout_ms(SOCK(s)->s_reconnmax, buf, szp, t)); } -static int +static nng_err sock_set_recvmaxsz(void *s, const void *buf, size_t sz, nni_type t) { return ( nni_copyin_size(&SOCK(s)->s_rcvmaxsz, buf, sz, 0, NNI_MAXSZ, t)); } -static int +static nng_err sock_get_recvmaxsz(void *s, void *buf, size_t *szp, nni_type t) { return (nni_copyout_size(SOCK(s)->s_rcvmaxsz, buf, szp, t)); } -static int +static nng_err sock_set_recvbuf(void *s, const void *buf, size_t sz, nni_type t) { - int len; - int rv; + int len; + nng_err rv; - if ((rv = nni_copyin_int(&len, buf, sz, 0, 8192, t)) != 0) { + if ((rv = nni_copyin_int(&len, buf, sz, 0, 8192, t)) != NNG_OK) { return (rv); } return (nni_msgq_resize(SOCK(s)->s_urq, len)); } -static int +static nng_err sock_get_recvbuf(void *s, void *buf, size_t *szp, nni_type t) { int len = nni_msgq_cap(SOCK(s)->s_urq); @@ -234,19 +234,19 @@ sock_get_recvbuf(void *s, void *buf, size_t *szp, nni_type t) return (nni_copyout_int(len, buf, szp, t)); } -static int +static nng_err sock_set_sendbuf(void *s, const void *buf, size_t sz, nni_type t) { - int len; - int rv; + int len; + nng_err rv; - if ((rv = nni_copyin_int(&len, buf, sz, 0, 8192, t)) != 0) { + if ((rv = nni_copyin_int(&len, buf, sz, 0, 8192, t)) != NNG_OK) { return (rv); } return (nni_msgq_resize(SOCK(s)->s_uwq, len)); } -static int +static nng_err sock_get_sendbuf(void *s, void *buf, size_t *szp, nni_type t) { int len = nni_msgq_cap(SOCK(s)->s_uwq); |
