diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-12-03 23:26:03 -0500 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-12-07 09:18:47 -0500 |
| commit | 9067535b2a04f632e8cc1850788942a9d68f2be0 (patch) | |
| tree | e9209cd1c76d9c19c8fb1ed04ad741fd39915743 /src | |
| parent | 0f5c2f763966b3caedbfc8a9eadff49ac9bd3a79 (diff) | |
| download | nng-9067535b2a04f632e8cc1850788942a9d68f2be0.tar.gz nng-9067535b2a04f632e8cc1850788942a9d68f2be0.tar.bz2 nng-9067535b2a04f632e8cc1850788942a9d68f2be0.zip | |
sockfd: check the result of nni_aio_schedule
This fixes a possible failure condition on teardown.
Diffstat (limited to 'src')
| -rw-r--r-- | src/core/sockfd.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/sockfd.c b/src/core/sockfd.c index 1b4dbc1d..90c476cc 100644 --- a/src/core/sockfd.c +++ b/src/core/sockfd.c @@ -109,6 +109,7 @@ static void sfd_listener_accept(void *arg, nng_aio *aio) { sfd_listener *l = arg; + int rv; if (nni_aio_begin(aio) != 0) { return; @@ -122,8 +123,9 @@ sfd_listener_accept(void *arg, nng_aio *aio) if (l->listen_cnt) { sfd_start_conn(l, aio); + } else if ((rv = nni_aio_schedule(aio, sfd_cancel_accept, l)) != 0) { + nni_aio_finish_error(aio, rv); } else { - nni_aio_schedule(aio, sfd_cancel_accept, l); nni_aio_list_append(&l->accept_q, aio); } nni_mtx_unlock(&l->mtx); |
