summaryrefslogtreecommitdiff
path: root/poll
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2018-01-02 18:09:46 +0000
committerYann Ylavic <ylavic@apache.org>2018-01-02 18:09:46 +0000
commitdf4d3ec8246679e427a4e6545ef7e1607f559b12 (patch)
treeea3eacaf2731c73e17ee8be3d3494de0c591a662 /poll
parent1b34c6f04f818eb3ec2bcb99b357f2cbe85d9d13 (diff)
downloadapr-df4d3ec8246679e427a4e6545ef7e1607f559b12.tar.gz
poll, port: follow up to r1819860.
This test is redundant now, axe it (no functional change). git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1819861 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poll')
-rw-r--r--poll/unix/port.c60
1 files changed, 29 insertions, 31 deletions
diff --git a/poll/unix/port.c b/poll/unix/port.c
index b33c9b0ee..c1e599412 100644
--- a/poll/unix/port.c
+++ b/poll/unix/port.c
@@ -406,38 +406,36 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset,
pollset_lock_rings();
- if (nget) {
- for (i = 0, j = 0; i < nget; i++) {
- ep = (pfd_elem_t *)pollset->p->port_set[i].portev_user;
- if ((pollset->flags & APR_POLLSET_WAKEABLE) &&
- ep->pfd.desc_type == APR_POLL_FILE &&
- ep->pfd.desc.f == pollset->wakeup_pipe[0]) {
- apr_poll_drain_wakeup_pipe(pollset->wakeup_pipe);
- rv = APR_EINTR;
- }
- else {
- pollset->p->result_set[j] = ep->pfd;
- pollset->p->result_set[j].rtnevents =
- get_revent(pollset->p->port_set[i].portev_events);
- j++;
- }
- /* If the ring element is still on the query ring, move it
- * to the add ring for re-association with the event port
- * later. (It may have already been moved to the dead ring
- * by a call to pollset_remove on another thread.)
- */
- if (ep->on_query_ring) {
- APR_RING_REMOVE(ep, link);
- ep->on_query_ring = 0;
- APR_RING_INSERT_TAIL(&(pollset->p->add_ring), ep,
- pfd_elem_t, link);
- }
+ for (i = 0, j = 0; i < nget; i++) {
+ ep = (pfd_elem_t *)pollset->p->port_set[i].portev_user;
+ if ((pollset->flags & APR_POLLSET_WAKEABLE) &&
+ ep->pfd.desc_type == APR_POLL_FILE &&
+ ep->pfd.desc.f == pollset->wakeup_pipe[0]) {
+ apr_poll_drain_wakeup_pipe(pollset->wakeup_pipe);
+ rv = APR_EINTR;
}
- if ((*num = j)) { /* any event besides wakeup pipe? */
- rv = APR_SUCCESS;
- if (descriptors) {
- *descriptors = pollset->p->result_set;
- }
+ else {
+ pollset->p->result_set[j] = ep->pfd;
+ pollset->p->result_set[j].rtnevents =
+ get_revent(pollset->p->port_set[i].portev_events);
+ j++;
+ }
+ /* If the ring element is still on the query ring, move it
+ * to the add ring for re-association with the event port
+ * later. (It may have already been moved to the dead ring
+ * by a call to pollset_remove on another thread.)
+ */
+ if (ep->on_query_ring) {
+ APR_RING_REMOVE(ep, link);
+ ep->on_query_ring = 0;
+ APR_RING_INSERT_TAIL(&(pollset->p->add_ring), ep,
+ pfd_elem_t, link);
+ }
+ }
+ if ((*num = j)) { /* any event besides wakeup pipe? */
+ rv = APR_SUCCESS;
+ if (descriptors) {
+ *descriptors = pollset->p->result_set;
}
}