diff options
Diffstat (limited to 'src/platform')
| -rw-r--r-- | src/platform/posix/posix_sockfd.c | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/platform/posix/posix_sockfd.c b/src/platform/posix/posix_sockfd.c index 7ed95681..96782c04 100644 --- a/src/platform/posix/posix_sockfd.c +++ b/src/platform/posix/posix_sockfd.c @@ -275,16 +275,11 @@ static void sfd_send(void *arg, nni_aio *aio) { nni_sfd_conn *c = arg; - int rv; - if (nni_aio_begin(aio) != 0) { - return; - } nni_mtx_lock(&c->mtx); - if ((rv = nni_aio_schedule(aio, sfd_cancel, c)) != 0) { + if (!nni_aio_start(aio, sfd_cancel, c)) { nni_mtx_unlock(&c->mtx); - nni_aio_finish_error(aio, rv); return; } nni_aio_list_append(&c->writeq, aio); @@ -305,16 +300,11 @@ static void sfd_recv(void *arg, nni_aio *aio) { nni_sfd_conn *c = arg; - int rv; - if (nni_aio_begin(aio) != 0) { - return; - } nni_mtx_lock(&c->mtx); - if ((rv = nni_aio_schedule(aio, sfd_cancel, c)) != 0) { + if (!nni_aio_start(aio, sfd_cancel, c)) { nni_mtx_unlock(&c->mtx); - nni_aio_finish_error(aio, rv); return; } nni_aio_list_append(&c->readq, aio); |
