summaryrefslogtreecommitdiff
path: root/poll
diff options
context:
space:
mode:
authorjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2004-07-07 07:40:12 +0000
committerjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2004-07-07 07:40:12 +0000
commiteb301d1b1fc0ae4d87f0923993b10fb7a37469b0 (patch)
treebf784b69c6b6d6ecdb8fb17342ba5533d3b3702c /poll
parentdfcafa29a7f98efb6700760dec68592ba3016147 (diff)
downloadlibapr-eb301d1b1fc0ae4d87f0923993b10fb7a37469b0.tar.gz
* poll/unix/poll.c (backend_cleanup): Only define if using epoll/kqueue.
(apr_pollset_destroy): Only run cleanup if using epoll/kqueue. (apr_pollset_add): Fix warning for ye olde platforms still using poll(). * configure.in: Just check for kqueue() in an AC_CHECK_FUNCS. git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@65265 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'poll')
-rw-r--r--poll/unix/poll.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/poll/unix/poll.c b/poll/unix/poll.c
index 4e36c3225..a04866fcd 100644
--- a/poll/unix/poll.c
+++ b/poll/unix/poll.c
@@ -374,6 +374,7 @@ struct apr_pollset_t {
#endif
};
+#if defined(HAVE_KQUEUE) || defined(HAVE_EPOLL)
static apr_status_t backend_cleanup(void *p_)
{
apr_pollset_t *pollset = (apr_pollset_t *)p_;
@@ -384,6 +385,7 @@ static apr_status_t backend_cleanup(void *p_)
#endif
return APR_SUCCESS;
}
+#endif /* HAVE_KQUEUE || HAVE_EPOLL */
APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset,
apr_uint32_t size,
@@ -433,7 +435,11 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset,
APR_DECLARE(apr_status_t) apr_pollset_destroy(apr_pollset_t *pollset)
{
+#if defined(HAVE_KQUEUE) || defined(HAVE_EPOLL)
return apr_pool_cleanup_run(pollset->pool, pollset, backend_cleanup);
+#else
+ return APR_SUCCESS;
+#endif
}
APR_DECLARE(apr_status_t) apr_pollset_add(apr_pollset_t *pollset,
@@ -571,7 +577,7 @@ APR_DECLARE(apr_status_t) apr_pollset_remove(apr_pollset_t *pollset,
#elif defined(HAVE_EPOLL)
struct epoll_event ev;
int ret = -1;
-#elif defined(HAVE_POLL)
+#elif !defined(HAVE_POLL)
apr_os_sock_t fd;
#endif