jorton 2004/07/07 00:40:12
Modified: poll/unix poll.c
. configure.in
Log:
* 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.
Revision Changes Path
1.46 +7 -1 apr/poll/unix/poll.c
Index: poll.c
===================================================================
RCS file: /home/cvs/apr/poll/unix/poll.c,v
retrieving revision 1.45
retrieving revision 1.46
diff -d -w -u -r1.45 -r1.46
--- poll.c 6 Jul 2004 03:38:06 -0000 1.45
+++ poll.c 7 Jul 2004 07:40:12 -0000 1.46
@@ -374,6 +374,7 @@
#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 @@
#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_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 @@
#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
1.595 +3 -6 apr/configure.in
Index: configure.in
===================================================================
RCS file: /home/cvs/apr/configure.in,v
retrieving revision 1.594
retrieving revision 1.595
diff -d -w -u -r1.594 -r1.595
--- configure.in 6 Jul 2004 03:38:06 -0000 1.594
+++ configure.in 7 Jul 2004 07:40:12 -0000 1.595
@@ -636,13 +636,10 @@
AC_SUBST(have_sigsuspend)
AC_SUBST(have_sigwait)
-AC_CHECK_FUNCS(poll)
-
-# Checks for the FreeBSD KQueue and Linux epoll interfaces:
-AC_CHECK_FUNC(kevent,
- [AC_DEFINE([HAVE_KQUEUE], 1, [Define if the KQueue interface is
supported])])
+AC_CHECK_FUNCS(poll kqueue)
-# epoll* may be available in libc but return ENOSYS on a pre-2.6 kernel.
+# Check for the Linux epoll interface; epoll* may be available in libc
+# but return ENOSYS on a pre-2.6 kernel, so do a run-time check.
AC_CACHE_CHECK([for epoll support], [apr_cv_epoll],
[AC_TRY_RUN([
#include <sys/epoll.h>