X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/631ef23987ef1b68a7525a18dc275c7ce6d2b1cf..5cd74a3b6c8ac2e62dcf1cd2f56e30955e0102fc:/libcharybdis/kqueue.c diff --git a/libcharybdis/kqueue.c b/libcharybdis/kqueue.c index 130dd40..6b82554 100644 --- a/libcharybdis/kqueue.c +++ b/libcharybdis/kqueue.c @@ -22,7 +22,7 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 * USA * - * $Id: kqueue.c 3356 2007-04-03 09:31:11Z nenolod $ + * $Id: kqueue.c 3358 2007-04-03 09:34:38Z nenolod $ */ #include "stdinc.h" @@ -30,6 +30,8 @@ #include "libcharybdis.h" +#define KE_LENGTH 128 + /* jlemon goofed up and didn't add EV_SET until fbsd 4.3 */ #ifndef EV_SET @@ -197,13 +199,9 @@ int comm_select(unsigned long delay) { int num, i; - static struct kevent *ke = NULL; + static struct kevent ke[KE_LENGTH]; struct timespec poll_time; - /* allocate ke if it has not been allocated already */ - if (ke == NULL) - ke = MyMalloc(sizeof(struct kevent) * comm_get_maxconnections()); - /* * remember we are doing NANOseconds here, not micro/milli. God knows * why jlemon used a timespec, but hey, he wrote the interface, not I