diff options
| author | Garrett D'Amore <garrett@damore.org> | 2021-12-25 18:01:49 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2021-12-25 18:05:56 -0800 |
| commit | 7b02ddc2d7077439992a10bb69553f89b5ee5903 (patch) | |
| tree | c3c6467330be2b38491f0df061d7016e713b1892 /src/sp/protocol/survey0/xrespond.c | |
| parent | 6237d268514e1f8aec562052954db22c4540eec3 (diff) | |
| download | nng-7b02ddc2d7077439992a10bb69553f89b5ee5903.tar.gz nng-7b02ddc2d7077439992a10bb69553f89b5ee5903.tar.bz2 nng-7b02ddc2d7077439992a10bb69553f89b5ee5903.zip | |
Socket and context initialization never fails.
This makes these functions entirely bullet proof, and eliminates
yet more error handling cases.
Diffstat (limited to 'src/sp/protocol/survey0/xrespond.c')
| -rw-r--r-- | src/sp/protocol/survey0/xrespond.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/sp/protocol/survey0/xrespond.c b/src/sp/protocol/survey0/xrespond.c index b2f203c3..81a40486 100644 --- a/src/sp/protocol/survey0/xrespond.c +++ b/src/sp/protocol/survey0/xrespond.c @@ -1,5 +1,5 @@ // -// Copyright 2020 Staysail Systems, Inc. <info@staysail.tech> +// Copyright 2021 Staysail Systems, Inc. <info@staysail.tech> // Copyright 2018 Capitar IT Group BV <info@capitar.com> // // This software is supplied under the terms of the MIT License, a @@ -67,8 +67,8 @@ xresp0_sock_fini(void *arg) nni_mtx_fini(&s->mtx); } -static int -xresp0_sock_init(void *arg, nni_sock *nsock) +static void +xresp0_sock_init(void *arg, nni_sock *ns) { xresp0_sock *s = arg; @@ -78,10 +78,8 @@ xresp0_sock_init(void *arg, nni_sock *nsock) nni_id_map_init(&s->pipes, 0, 0, false); nni_aio_init(&s->aio_getq, xresp0_sock_getq_cb, s); - s->urq = nni_sock_recvq(nsock); - s->uwq = nni_sock_sendq(nsock); - - return (0); + s->urq = nni_sock_recvq(ns); + s->uwq = nni_sock_sendq(ns); } static void |
