]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - libcharybdis/poll.c
[svn] - update config files
[irc/rqf/shadowircd.git] / libcharybdis / poll.c
index 6804a83a0df9cd96861a015f5aa6690c54a46712..8023b11246e814506b593922c7cdcba71b09295c 100644 (file)
@@ -22,7 +22,7 @@
  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  *  USA
  *
- *  $Id: poll.c 3243 2007-03-05 18:40:39Z nenolod $
+ *  $Id: poll.c 3354 2007-04-03 09:21:31Z nenolod $
  */
 
 #include "config.h"
@@ -63,14 +63,15 @@ void
 init_netio(void)
 {
        int fd;
+       int maxconn = comm_get_maxconnections();
 
-       pollfd_list.pollfds = calloc(sizeof(struct pollfd), MAXCONNECTIONS);
+       pollfd_list.pollfds = calloc(sizeof(struct pollfd), maxconn);
 
-       for (fd = 0; fd < MAXCONNECTIONS; fd++)
+       for (fd = 0; fd < maxconn; fd++)
                pollfd_list.pollfds[fd].fd = -1;
 
        pollfd_list.maxindex = 0;
-       pollfd_list.allocated = MAXCONNECTIONS;
+       pollfd_list.allocated = maxconn;
 }
 
 static inline void
@@ -122,7 +123,7 @@ poll_findslot(void)
 static void
 poll_update_pollfds(int fd, short event, PF * handler)
 {
-       fde_t *F = comm_locate_table(fd);
+       fde_t *F = comm_locate_fd(fd);
        int comm_index;
 
        resize_poll_array(fd);