diff options
author | brianp <brianp@13f79535-47bb-0310-9956-ffa450edef68> | 2002-08-03 00:10:57 +0000 |
---|---|---|
committer | brianp <brianp@13f79535-47bb-0310-9956-ffa450edef68> | 2002-08-03 00:10:57 +0000 |
commit | 973aba6127f4310a2a04bfc9989cd1025177f54b (patch) | |
tree | 5b9dde8aa37bb38818b1d38daaedd52ad6112c13 | |
parent | ff0b688ec3768c80e9b9b538d955a862c228ab39 (diff) | |
download | libapr-973aba6127f4310a2a04bfc9989cd1025177f54b.tar.gz |
On systems without poll, limit apr_pollset's capacity to
the number of descriptors that select can handle
(this is why testpoll test #4 was failing on win32)
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@63779 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | poll/unix/poll.c | 6 | ||||
-rw-r--r-- | test/testpoll.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/poll/unix/poll.c b/poll/unix/poll.c index 58c520147..969726ddd 100644 --- a/poll/unix/poll.c +++ b/poll/unix/poll.c @@ -325,6 +325,12 @@ APR_DECLARE(apr_status_t) apr_pollset_create(apr_pollset_t **pollset, apr_uint32_t size, apr_pool_t *p) { +#if !defined(HAVE_POLL) && defined(FD_SETSIZE) + if (size > FD_SETSIZE) { + *pollset = NULL; + return APR_EINVAL; + } +#endif *pollset = apr_palloc(p, sizeof(**pollset)); (*pollset)->nelts = 0; (*pollset)->nalloc = size; diff --git a/test/testpoll.c b/test/testpoll.c index 8a74e62b3..0827777ec 100644 --- a/test/testpoll.c +++ b/test/testpoll.c @@ -141,7 +141,7 @@ static void recv_msg(apr_socket_t **sockarray, int which, apr_pool_t *p) } #define SMALL_NUM_SOCKETS 3 -#define LARGE_NUM_SOCKETS 100 +#define LARGE_NUM_SOCKETS 64 int main(void) { |