Committer : entrope
CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Commit time: 2005-07-12 02:13:21 UTC
Modified files:
ChangeLog include/sys.h ircd/engine_select.c ircd/s_bsd.c
Log message:
Localize FD_SETSIZE manipulation to engine_select.c.
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.657 ircu2.10/ChangeLog:1.658
--- ircu2.10/ChangeLog:1.657 Sun Jul 3 19:27:15 2005
+++ ircu2.10/ChangeLog Mon Jul 11 19:13:08 2005
@@ -1,3 +1,14 @@
+2005-07-11 Reed Loden <[EMAIL PROTECTED]>
+
+ * include/sys.h: Move FD_SETSIZE redefinition to engine_select.c.
+
+ * ircd/s_bsd.c: Move FD_SETSIZE sanity check to engine_select.c
+ Remove unused #include <sys/poll.h>.
+
+ * ircd/engine_select.c: Put FD_SETSIZE redefinition and sanity
+ checks here, since they are not used elsewhere in the daemon.
+ [Order slightly changed by Michael Poole to compile.]
+
2005-07-03 Michael Poole <[EMAIL PROTECTED]>
* ircd/convert-conf.c: New file.
Index: ircu2.10/include/sys.h
diff -u ircu2.10/include/sys.h:1.5 ircu2.10/include/sys.h:1.6
--- ircu2.10/include/sys.h:1.5 Tue Dec 28 14:35:37 2004
+++ ircu2.10/include/sys.h Mon Jul 11 19:13:10 2005
@@ -16,7 +16,7 @@
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
- * $Id: sys.h,v 1.5 2004/12/28 22:35:37 entrope Exp $
+ * $Id: sys.h,v 1.6 2005/07/12 02:13:10 entrope Exp $
*/
#ifndef INCLUDED_sys_h
#define INCLUDED_sys_h
@@ -28,13 +28,6 @@
*/
#define MAXCLIENTS (MAXCONNECTIONS-24)
-/* Define FD_SETSIZE to what we want before including sys/types.h on BSD */
-#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__)
-#if ((!defined(USE_POLL)) && (!defined(FD_SETSIZE)))
-#define FD_SETSIZE ((MAXCONNECTIONS)+4)
-#endif
-#endif
-
#define IRCD_MAX(a, b) ((a) > (b) ? (a) : (b))
#define IRCD_MIN(a, b) ((a) < (b) ? (a) : (b))
Index: ircu2.10/ircd/engine_select.c
diff -u ircu2.10/ircd/engine_select.c:1.6 ircu2.10/ircd/engine_select.c:1.7
--- ircu2.10/ircd/engine_select.c:1.6 Fri Dec 10 21:13:44 2004
+++ ircu2.10/ircd/engine_select.c Mon Jul 11 19:13:10 2005
@@ -18,23 +18,23 @@
*/
/** @file
* @brief BSD sockets select() event engine.
- * @version $Id: engine_select.c,v 1.6 2004/12/11 05:13:44 klmitch Exp $
+ * @version $Id: engine_select.c,v 1.7 2005/07/12 02:13:10 entrope Exp $
*/
#include "config.h"
-#include "ircd_events.h"
-
-#include "ircd.h"
-#include "ircd_log.h"
-#include "s_debug.h"
-
/* On BSD, define FD_SETSIZE to what we want before including sys/types.h */
#if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__bsdi__)
# if !defined(FD_SETSIZE)
-# define FD_SETSIZE MAXCONNECTIONS
+# define FD_SETSIZE ((MAXCONNECTIONS)+4)
# endif
#endif
+#include "ircd_events.h"
+
+#include "ircd.h"
+#include "ircd_log.h"
+#include "s_debug.h"
+
/* #include <assert.h> -- Now using assert in ircd_log.h */
#include <errno.h>
#include <string.h> /* needed for bzero() on OS X */
@@ -44,6 +44,21 @@
#include <time.h>
#include <unistd.h>
+#if FD_SETSIZE < (MAXCONNECTIONS + 4)
+/*
+ * Sanity check
+ *
+ * All operating systems work when MAXCONNECTIONS <= 252.
+ * Most operating systems work when MAXCONNECTIONS <= 1020 and FD_SETSIZE is
+ * updated correctly in the system headers (on BSD systems sys/types.h might
+ * have abruptly redefined it so the check is still done), you might
+ * already need to recompile your kernel.
+ * For larger FD_SETSIZE your mileage may vary (kernel patches may be needed).
+ * The check is _NOT_ done if we will not use FD_SETS at all (USE_POLL)
+ */
+# error FD_SETSIZE is too small or MAXCONNECTIONS too large.
+#endif
+
#define SELECT_ERROR_THRESHOLD 20 /**< after 20 select errors, restart */
#define ERROR_EXPIRE_TIME 3600 /**< expire errors after an hour */
Index: ircu2.10/ircd/s_bsd.c
diff -u ircu2.10/ircd/s_bsd.c:1.79 ircu2.10/ircd/s_bsd.c:1.80
--- ircu2.10/ircd/s_bsd.c:1.79 Mon Jun 27 17:42:06 2005
+++ ircu2.10/ircd/s_bsd.c Mon Jul 11 19:13:10 2005
@@ -19,7 +19,7 @@
*/
/** @file
* @brief Functions that now (or in the past) relied on BSD APIs.
- * @version $Id: s_bsd.c,v 1.79 2005/06/28 00:42:06 entrope Exp $
+ * @version $Id: s_bsd.c,v 1.80 2005/07/12 02:13:10 entrope Exp $
*/
#include "config.h"
@@ -71,10 +71,6 @@
#include <sys/utsname.h>
#include <unistd.h>
-#ifdef USE_POLL
-#include <sys/poll.h>
-#endif /* USE_POLL */
-
/** Array of my own clients, indexed by file descriptor. */
struct Client* LocalClientArray[MAXCONNECTIONS];
/** Maximum file descriptor in current use. */
@@ -108,24 +104,6 @@
static void client_sock_callback(struct Event* ev);
static void client_timer_callback(struct Event* ev);
-#if !defined(USE_POLL)
-#if FD_SETSIZE < (MAXCONNECTIONS + 4)
-/*
- * Sanity check
- *
- * All operating systems work when MAXCONNECTIONS <= 252.
- * Most operating systems work when MAXCONNECTIONS <= 1020 and FD_SETSIZE is
- * updated correctly in the system headers (on BSD systems our sys.h has
- * defined FD_SETSIZE to MAXCONNECTIONS+4 before including the system's
headers
- * but sys/types.h might have abruptly redefined it so the check is still
- * done), you might already need to recompile your kernel.
- * For larger FD_SETSIZE your mileage may vary (kernel patches may be needed).
- * The check is _NOT_ done if we will not use FD_SETS at all (USE_POLL)
- */
-#error "FD_SETSIZE is too small or MAXCONNECTIONS too large."
-#endif
-#endif
-
/*
* Cannot use perror() within daemon. stderr is closed in
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches