Commit 90c3822b authored by Simon Kelley's avatar Simon Kelley

Grow pollfds array exponentially.

parent c895a062
...@@ -102,8 +102,9 @@ void poll_listen(int fd, short event) ...@@ -102,8 +102,9 @@ void poll_listen(int fd, short event)
{ {
/* Array too small, extend. */ /* Array too small, extend. */
struct pollfd *new; struct pollfd *new;
arrsize += 64;
arrsize = (arrsize == 0) ? 64 : arrsize * 2;
if (!(new = whine_malloc(arrsize * sizeof(struct pollfd)))) if (!(new = whine_malloc(arrsize * sizeof(struct pollfd))))
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment