X-Git-Url: https://git.llucax.com/software/libev.git/blobdiff_plain/228b0b302ab0857b23efad5a8b2429de2c0ccc00..7adde6c7c7a709d21a4cacdf6a1b3bc9418245df:/ev_poll.c diff --git a/ev_poll.c b/ev_poll.c index 07b1f5c..b58ce82 100644 --- a/ev_poll.c +++ b/ev_poll.c @@ -42,6 +42,10 @@ static void poll_modify (EV_P_ int fd, int oev, int nev) { int idx; + + if (oev == nev) + return; + array_needsize (pollidxs, pollidxmax, fd + 1, pollidx_init); idx = pollidxs [fd]; @@ -101,5 +105,15 @@ poll_init (EV_P_ int flags) method_modify = poll_modify; method_poll = poll_poll; + pollidxs = 0; pollidxmax = 0; + polls = 0; pollmax = 0; pollcnt = 0; + return EVMETHOD_POLL; } + +static void +poll_destroy (EV_P) +{ + free (pollidxs); + free (polls); +}