diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-07-05 01:05:18 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-07-05 01:05:18 -0700 |
| commit | 33f7dcc44cc76260712f9be0f8533e7e81657b45 (patch) | |
| tree | c6b8b2349e6935b1f857b6bee377cd19b1c040af /src/platform/posix/posix_pipedesc.c | |
| parent | 16a43040ef29f77375d226f669770e64a42d278c (diff) | |
| download | nng-33f7dcc44cc76260712f9be0f8533e7e81657b45.tar.gz nng-33f7dcc44cc76260712f9be0f8533e7e81657b45.tar.bz2 nng-33f7dcc44cc76260712f9be0f8533e7e81657b45.zip | |
epdesc functionality.
Diffstat (limited to 'src/platform/posix/posix_pipedesc.c')
| -rw-r--r-- | src/platform/posix/posix_pipedesc.c | 23 |
1 files changed, 3 insertions, 20 deletions
diff --git a/src/platform/posix/posix_pipedesc.c b/src/platform/posix/posix_pipedesc.c index 14a5c8ab..c3e29c33 100644 --- a/src/platform/posix/posix_pipedesc.c +++ b/src/platform/posix/posix_pipedesc.c @@ -99,7 +99,6 @@ nni_posix_pipedesc_dowrite(nni_posix_pipedesc *pd) } // We completed the entire operation on this aioq. - nni_list_remove(&pd->writeq, aio); nni_posix_pipedesc_finish(aio, 0); // Go back to start of loop to see if there is another @@ -231,24 +230,10 @@ nni_posix_pipedesc_cb(void *arg) void nni_posix_pipedesc_close(nni_posix_pipedesc *pd) { - nni_posix_pollq *pq; - nni_aio *aio; - - pq = pd->pq; - - nni_posix_pollq_cancel(pq, &pd->node); + nni_posix_pollq_cancel(pd->pq, &pd->node); nni_mtx_lock(&pd->mtx); - if (pd->fd != -1) { - // Let any peer know we are closing. - shutdown(pd->fd, SHUT_RDWR); - } - while ((aio = nni_list_first(&pd->readq)) != NULL) { - nni_posix_pipedesc_finish(aio, NNG_ECLOSED); - } - while ((aio = nni_list_first(&pd->writeq)) != NULL) { - nni_posix_pipedesc_finish(aio, NNG_ECLOSED); - } + nni_posix_pipedesc_doclose(pd); nni_mtx_unlock(&pd->mtx); } @@ -256,9 +241,7 @@ nni_posix_pipedesc_close(nni_posix_pipedesc *pd) static void nni_posix_pipedesc_cancel(nni_aio *aio) { - nni_posix_pipedesc *pd; - - pd = aio->a_prov_data; + nni_posix_pipedesc *pd = aio->a_prov_data; nni_mtx_lock(&pd->mtx); nni_aio_list_remove(aio); |
