diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-12-26 12:15:48 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-12-26 12:53:46 -0800 |
| commit | 2c4324c2b7a3dd5583b3b2c499575cf1c8e52e0c (patch) | |
| tree | 6c6a70bcc3d2f2d78981dcf662b178e0a2da7277 /src/platform | |
| parent | b5826dac78e75520c26f2d84a952fe04d69fa2d3 (diff) | |
| download | nng-2c4324c2b7a3dd5583b3b2c499575cf1c8e52e0c.tar.gz nng-2c4324c2b7a3dd5583b3b2c499575cf1c8e52e0c.tar.bz2 nng-2c4324c2b7a3dd5583b3b2c499575cf1c8e52e0c.zip | |
sockfd: convert to use nni_aio_start
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); |
