summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorniq <niq@13f79535-47bb-0310-9956-ffa450edef68>2018-08-24 21:13:34 +0000
committerniq <niq@13f79535-47bb-0310-9956-ffa450edef68>2018-08-24 21:13:34 +0000
commit103088d71ea4418b1c4779bfa0d37c61d83a2d7f (patch)
treeaf781d8c9e7e2d050f5e7f16b7b16bb4f8999a3c
parent57eeaa3614bd924f2291b015cb57441f52e9bb0a (diff)
downloadlibapr-103088d71ea4418b1c4779bfa0d37c61d83a2d7f.tar.gz
Tidyup of ugly practice that stuck out in review of 1.6 changes.
No functional change. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/1.6.x@1838963 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--poll/unix/port.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/poll/unix/port.c b/poll/unix/port.c
index c1e599412..94b6fa397 100644
--- a/poll/unix/port.c
+++ b/poll/unix/port.c
@@ -356,7 +356,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset,
apr_os_sock_t fd;
int ret;
unsigned int nget, i;
- apr_int32_t j;
+ apr_int32_t nres = 0;
pfd_elem_t *ep;
apr_status_t rv = APR_SUCCESS;
@@ -406,7 +406,7 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset,
pollset_lock_rings();
- for (i = 0, j = 0; i < nget; i++) {
+ for (i = 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 &&
@@ -415,10 +415,10 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset,
rv = APR_EINTR;
}
else {
- pollset->p->result_set[j] = ep->pfd;
- pollset->p->result_set[j].rtnevents =
+ pollset->p->result_set[nres] = ep->pfd;
+ pollset->p->result_set[nres].rtnevents =
get_revent(pollset->p->port_set[i].portev_events);
- j++;
+ ++nres;
}
/* If the ring element is still on the query ring, move it
* to the add ring for re-association with the event port
@@ -432,7 +432,8 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset,
pfd_elem_t, link);
}
}
- if ((*num = j)) { /* any event besides wakeup pipe? */
+ if (nres > 0) { /* any event besides wakeup pipe? */
+ *num = nres;
rv = APR_SUCCESS;
if (descriptors) {
*descriptors = pollset->p->result_set;