summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/poll.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/poll.c b/src/poll.c
index 01b3564..d71b1b9 100644
--- a/src/poll.c
+++ b/src/poll.c
@@ -102,8 +102,9 @@ void poll_listen(int fd, short event)
{
/* Array too small, extend. */
struct pollfd *new;
- arrsize += 64;
-
+
+ arrsize = (arrsize == 0) ? 64 : arrsize * 2;
+
if (!(new = whine_malloc(arrsize * sizeof(struct pollfd))))
return;