You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@apr.apache.org by yl...@apache.org on 2018/01/03 09:33:47 UTC
svn commit: r1819934 - /apr/apr/trunk/poll/unix/kqueue.c
Author: ylavic
Date: Wed Jan 3 09:33:47 2018
New Revision: 1819934
URL: http://svn.apache.org/viewvc?rev=1819934&view=rev
Log:
poll, kqueue: save a pollfd (mem)copy per returned event.
Modified:
apr/apr/trunk/poll/unix/kqueue.c
Modified: apr/apr/trunk/poll/unix/kqueue.c
URL: http://svn.apache.org/viewvc/apr/apr/trunk/poll/unix/kqueue.c?rev=1819934&r1=1819933&r2=1819934&view=diff
==============================================================================
--- apr/apr/trunk/poll/unix/kqueue.c (original)
+++ apr/apr/trunk/poll/unix/kqueue.c Wed Jan 3 09:33:47 2018
@@ -257,7 +257,6 @@ static apr_status_t impl_pollset_poll(ap
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(ap
}
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);