apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yla...@apache.org
Subject svn commit: r1819934 - /apr/apr/trunk/poll/unix/kqueue.c
Date Wed, 03 Jan 2018 09:33:47 GMT
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);



Mime
View raw message