]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - libcharybdis/kqueue.c
[svn] Apply ratbox flood fix.
[irc/rqf/shadowircd.git] / libcharybdis / kqueue.c
index 130dd40a512e78276fc78c0ad5a7a5088197929a..6b82554ebcd7cd43e195008cd40f79bbd7eb5173 100644 (file)
@@ -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