summaryrefslogtreecommitdiff
path: root/poll
diff options
context:
space:
mode:
authorYann Ylavic <ylavic@apache.org>2018-01-03 09:33:47 +0000
committerYann Ylavic <ylavic@apache.org>2018-01-03 09:33:47 +0000
commit11d1564953940319330457c33b8e29eafbfd2a26 (patch)
treeda40f311bc074ef32bd90b32c15be4a01c147794 /poll
parentdf4d3ec8246679e427a4e6545ef7e1607f559b12 (diff)
downloadapr-11d1564953940319330457c33b8e29eafbfd2a26.tar.gz
poll, kqueue: save a pollfd (mem)copy per returned event.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1819934 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poll')
-rw-r--r--poll/unix/kqueue.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c
index 6a0ae614a..548464db1 100644
--- a/poll/unix/kqueue.c
+++ b/poll/unix/kqueue.c
@@ -257,7 +257,6 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset,
int ret;
struct timespec tv, *tvptr;
apr_status_t rv = APR_SUCCESS;
- apr_pollfd_t fd;
*num = 0;
@@ -280,17 +279,18 @@ static apr_status_t impl_pollset_poll(apr_pollset_t *pollset,
}
else {
int i, j;
+ const apr_pollfd_t *fd;
for (i = 0, j = 0; i < ret; i++) {
- fd = (((pfd_elem_t *)(pollset->p->ke_set[i].udata))->pfd);
+ fd = &((pfd_elem_t *)pollset->p->ke_set[i].udata)->pfd;
if ((pollset->flags & APR_POLLSET_WAKEABLE) &&
- fd.desc_type == APR_POLL_FILE &&
- fd.desc.f == pollset->wakeup_pipe[0]) {
+ fd->desc_type == APR_POLL_FILE &&
+ fd->desc.f == pollset->wakeup_pipe[0]) {
apr_poll_drain_wakeup_pipe(pollset->wakeup_pipe);
rv = APR_EINTR;
}
else {
- pollset->p->result_set[j] = fd;
+ pollset->p->result_set[j] = *fd;
pollset->p->result_set[j].rtnevents =
get_kqueue_revent(pollset->p->ke_set[i].filter,
pollset->p->ke_set[i].flags);