diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-07-04 12:09:02 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-07-04 12:09:02 -0700 |
| commit | 5b45db0aeb1026fcf7bbdec0e6451d1cfaac58f1 (patch) | |
| tree | bc18b4435a3df8b6e920ac6dcbd1a12e1e361496 /src | |
| parent | f39b983f7acbb13c6818ff67b214fdf89597b73d (diff) | |
| download | nng-5b45db0aeb1026fcf7bbdec0e6451d1cfaac58f1.tar.gz nng-5b45db0aeb1026fcf7bbdec0e6451d1cfaac58f1.tar.bz2 nng-5b45db0aeb1026fcf7bbdec0e6451d1cfaac58f1.zip | |
All pipes are nonblocking.
Diffstat (limited to 'src')
| -rw-r--r-- | src/platform/posix/posix_poll.c | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/platform/posix/posix_poll.c b/src/platform/posix/posix_poll.c index 97868ff7..973c5d21 100644 --- a/src/platform/posix/posix_poll.c +++ b/src/platform/posix/posix_poll.c @@ -42,7 +42,6 @@ struct nni_posix_pipedesc { nni_list writeq; nni_list_node node; nni_posix_pollq * pq; - int nonblocking; }; @@ -790,12 +789,6 @@ nni_posix_pipedesc_submit(nni_posix_pipedesc *pd, nni_list *l, nni_aio *aio) nni_mtx_unlock(&pq->mtx); return; } - // XXX: We really should just make all the FDs nonblocking, but we - // need to fix the negotiation phase. - if (pd->nonblocking == 0) { - (void) fcntl(pd->fd, F_SETFL, O_NONBLOCK); - pd->nonblocking = 1; - } if (!nni_list_active(&pq->pds, pd)) { if ((rv = nni_posix_poll_grow(pq)) != 0) { nni_posix_pipedesc_finish(aio, rv); @@ -837,7 +830,7 @@ nni_posix_pipedesc_init(nni_posix_pipedesc **pdp, int fd) pd->pq = &nni_posix_global_pollq; pd->fd = fd; pd->index = 0; - pd->nonblocking = 0; + (void) fcntl(pd->fd, F_SETFL, O_NONBLOCK); NNI_LIST_INIT(&pd->readq, nni_aio, a_prov_node); NNI_LIST_INIT(&pd->writeq, nni_aio, a_prov_node); |
