[ircd-ratbox] devpoll in 2.2.0rc2

Dustin Marquess jailbird at alcatraz.fdf.net
Tue Feb 21 18:57:11 UTC 2006


Okay, that was the push I needed.  I tried fixing it myself, and I ended 
up with an ircd with broken connectivity :).

This should fix the rest of it.  Tested on Solaris & Tru64...

-Dustin

--- devpoll.c   2006-02-21 12:14:46.600354763 -0600
+++ /home/jailbird/devpoll.c    2006-02-21 12:54:24.797807221 -0600
@@ -26,10 +26,11 @@
   */

  #include "config.h"

  #include "stdinc.h"
+#include <poll.h>
  #include <sys/devpoll.h>

  #include "config.h"
  #include "commio.h"
  #include "class.h"
@@ -52,11 +53,11 @@
  #include "memory.h"

  static void devpoll_update_events(int, short, PF *);
  static int dpfd;
  static short *fdmask;
-static pollfd *npollfds;
+static struct pollfd *npollfds;
  static void devpoll_update_events(int, short, PF *);
  static void devpoll_write_update(int, int);
  static int maxfd;

  /* #define NOTYET 1 */
@@ -170,12 +171,12 @@
   */
  void
  init_netio(void)
  {
          maxfd = getdtablesize() - 2; /* This makes more sense than 
HARD_FDLIMIT */
-       fdmask = ircd_malloc(sizeof(fdmask) * maxfd + 1);
-       npollfds = ircd_malloc(sizeof(struct pollfd) * maxfd + 1);
+       fdmask = MyMalloc(sizeof(fdmask) * maxfd + 1);
+       npollfds = MyMalloc(sizeof(struct pollfd) * maxfd + 1);

         dpfd = open("/dev/poll", O_RDWR);
         if(dpfd < 0)
         {
                 fprintf(stderr,


Aaron Sethman wrote:
> Committed a fix for this.  I don't have access to a Solaris box to test 
> it at the moment, so it at least *looks* correct now.
> 
> -Aaron
> 
> On Mon, 20 Feb 2006, Dustin Marquess wrote:
> 
>> Just a quick note... It looks like the devpoll.c module in 2.2.0rc2 
>> was never updated to handle the new dynamic maxclients system.  It is 
>> still using:
>>
>> static short fdmask[POLL_LENGTH];
>>
>> -Dustin



More information about the ircd-ratbox mailing list