diff options
author | Jeff Trawick <trawick@apache.org> | 2009-03-01 02:57:09 +0000 |
---|---|---|
committer | Jeff Trawick <trawick@apache.org> | 2009-03-01 02:57:09 +0000 |
commit | 8258bc115340a28c4ae953fe5b75688a67ebcc7c (patch) | |
tree | d89e248e024a574af16d10ece0aea586cecffeab /poll | |
parent | 6f7bccf0450a11eaeacadc76c9c0cd51bb341eb2 (diff) | |
download | apr-8258bc115340a28c4ae953fe5b75688a67ebcc7c.tar.gz |
revert a non-critical part of 748951: the needless use of separate temporary kevent
structures for POLLIN vs. POLLOUT
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@748953 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poll')
-rw-r--r-- | poll/unix/kqueue.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/poll/unix/kqueue.c b/poll/unix/kqueue.c index e0bd37d35..767880e7e 100644 --- a/poll/unix/kqueue.c +++ b/poll/unix/kqueue.c @@ -44,8 +44,7 @@ static apr_int16_t get_kqueue_revent(apr_int16_t event, apr_int16_t flags) struct apr_pollset_private_t { int kqueue_fd; - struct kevent in_kevent; - struct kevent out_kevent; + struct kevent kevent; apr_uint32_t setsize; struct kevent *ke_set; apr_pollfd_t *result_set; @@ -157,18 +156,18 @@ static apr_status_t impl_pollset_add(apr_pollset_t *pollset, } if (descriptor->reqevents & APR_POLLIN) { - EV_SET(&pollset->p->in_kevent, fd, EVFILT_READ, EV_ADD, 0, 0, elem); + EV_SET(&pollset->p->kevent, fd, EVFILT_READ, EV_ADD, 0, 0, elem); - if (kevent(pollset->p->kqueue_fd, &pollset->p->in_kevent, 1, NULL, 0, + if (kevent(pollset->p->kqueue_fd, &pollset->p->kevent, 1, NULL, 0, NULL) == -1) { rv = apr_get_netos_error(); } } if (descriptor->reqevents & APR_POLLOUT && rv == APR_SUCCESS) { - EV_SET(&pollset->p->out_kevent, fd, EVFILT_WRITE, EV_ADD, 0, 0, elem); + EV_SET(&pollset->p->kevent, fd, EVFILT_WRITE, EV_ADD, 0, 0, elem); - if (kevent(pollset->p->kqueue_fd, &pollset->p->out_kevent, 1, NULL, 0, + if (kevent(pollset->p->kqueue_fd, &pollset->p->kevent, 1, NULL, 0, NULL) == -1) { rv = apr_get_netos_error(); } @@ -204,18 +203,18 @@ static apr_status_t impl_pollset_remove(apr_pollset_t *pollset, } if (descriptor->reqevents & APR_POLLIN) { - EV_SET(&pollset->p->in_kevent, fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); + EV_SET(&pollset->p->kevent, fd, EVFILT_READ, EV_DELETE, 0, 0, NULL); - if (kevent(pollset->p->kqueue_fd, &pollset->p->in_kevent, 1, NULL, 0, + if (kevent(pollset->p->kqueue_fd, &pollset->p->kevent, 1, NULL, 0, NULL) == -1) { rv = APR_NOTFOUND; } } if (descriptor->reqevents & APR_POLLOUT && rv == APR_SUCCESS) { - EV_SET(&pollset->p->out_kevent, fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL); + EV_SET(&pollset->p->kevent, fd, EVFILT_WRITE, EV_DELETE, 0, 0, NULL); - if (kevent(pollset->p->kqueue_fd, &pollset->p->out_kevent, 1, NULL, 0, + if (kevent(pollset->p->kqueue_fd, &pollset->p->kevent, 1, NULL, 0, NULL) == -1) { rv = APR_NOTFOUND; } |