[cvslog] (2002-09-20 20:18:32 UTC) Module eggdrop1.7: Change committed

cvslog cvs at tsss.org
Fri Sep 20 15:19:00 CST 2002


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.7
Commit time: 2002-09-20 20:18:32 UTC
Commited by: stdarg <stdarg at techmonkeys.org>

Modified files:
     configure.ac lib/eggdrop/eggdns.c lib/eggdrop/module.h
     lib/eggdrop/my_socket.c modules/Makefile.am

Added files:
     lib/compat/poll.c lib/compat/poll.h modules/server/binds.h

Log message:

* compat entries for poll, and a server module file I forgot

---------------------- diff included ----------------------
Index: eggdrop1.7/configure.ac
diff -u eggdrop1.7/configure.ac:1.24 eggdrop1.7/configure.ac:1.25
--- eggdrop1.7/configure.ac:1.24	Thu Sep 19 21:06:24 2002
+++ eggdrop1.7/configure.ac	Fri Sep 20 15:18:22 2002
@@ -172,6 +172,6 @@
 EGG_LTLIBOBJS
 
 # FIXME: module's Makefiles list will prolly become dynamic
-AC_OUTPUT([Makefile doc/Makefile intl/Makefile lib/Makefile lib/adns/Makefile lib/compat/Makefile lib/eggdrop/Makefile lib/egglib/Makefile modules/Makefile modules/blowfish/Makefile modules/compress/Makefile modules/console/Makefile modules/javascript/Makefile modules/perlscript/Makefile modules/server/Makefile modules/tclscript/Makefile po/Makefile.in scripts/Makefile nettype/Makefile src/Makefile])
+AC_OUTPUT([Makefile doc/Makefile intl/Makefile lib/Makefile lib/adns/Makefile lib/compat/Makefile lib/eggdrop/Makefile lib/egglib/Makefile modules/Makefile modules/blowfish/Makefile modules/javascript/Makefile modules/perlscript/Makefile modules/server/Makefile modules/tclscript/Makefile po/Makefile.in scripts/Makefile nettype/Makefile src/Makefile])
 
 EGG_MSG_CONFIGURE_END
Index: eggdrop1.7/lib/compat/poll.c
diff -u /dev/null eggdrop1.7/lib/compat/poll.c:1.1
--- /dev/null	Fri Sep 20 15:18:32 2002
+++ eggdrop1.7/lib/compat/poll.c	Fri Sep 20 15:18:22 2002
@@ -0,0 +1,67 @@
+#if HAVE_CONFIG_H
+	#include <config.h>
+#endif
+
+#include <stdio.h>
+#include <errno.h>
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h>
+#endif
+#include "poll.h"
+
+int poll(struct pollfd *pollfds, int npollfds, int timeout)
+{
+	fd_set reads, writes, excepts;
+	int i, n;
+	int highest = -1;
+	int events;
+
+	FD_ZERO(&reads); FD_ZERO(&writes); FD_ZERO(&excepts);
+
+	/* Convert pollfds array to fd_set's. */
+	for (i = 0; i < npollfds; i++) {
+		/* Ignore invalid descriptors. */
+		n = pollfds[i].fd;
+		if (n < 0) continue;
+
+		events = pollfds[i].events;
+		if (events & POLLIN) FD_SET(n, &reads);
+		if (events & POLLOUT) FD_SET(n, &writes);
+		FD_SET(n, &excepts);
+		if (n > highest) highest = n;
+	}
+
+	if (timeout >= 0) {
+		struct timeval tv;
+		tv.tv_sec = (timeout / 1000);
+		timeout -= 1000 * tv.tv_sec;
+		tv.tv_usec = timeout * 1000;
+		events = select(highest+1, &reads, &writes, &excepts, &tv);
+	}
+	else events = select(highest+1, &reads, &writes, &excepts, NULL);
+
+	if (events < 0) {
+		/* There is a bad descriptor among us... find it! */
+		char temp[1];
+		events = 0;
+		for (i = 0; i < npollfds; i++) {
+			if (pollfds[i].fd < 0) continue;
+			errno = 0;
+			n = write(pollfds[i].fd, temp,  0);
+			if (n < 0 && errno != EINVAL) {
+				pollfds[i].revents = POLLNVAL;
+				events++;
+			}
+			else pollfds[i].revents = 0;
+		}
+	}
+	else for (i = 0; i < npollfds; i++) {
+		n = pollfds[i].fd;
+		pollfds[i].revents = 0;
+		if (FD_ISSET(n, &reads)) pollfds[i].revents |= POLLIN;
+		if (FD_ISSET(n, &writes)) pollfds[i].revents |= POLLOUT;
+		if (FD_ISSET(n, &excepts)) pollfds[i].revents |= POLLERR;
+	}
+
+	return(events);
+}
Index: eggdrop1.7/lib/compat/poll.h
diff -u /dev/null eggdrop1.7/lib/compat/poll.h:1.1
--- /dev/null	Fri Sep 20 15:18:32 2002
+++ eggdrop1.7/lib/compat/poll.h	Fri Sep 20 15:18:22 2002
@@ -0,0 +1,18 @@
+#ifndef _MY_POLL_H_
+#define _MY_POLL_H_
+
+#define POLLIN	1
+#define POLLOUT	2
+#define POLLERR	4
+#define POLLNVAL	8
+#define POLLHUP	16
+
+struct pollfd {
+	int fd;
+	short events;
+	short revents;
+};
+
+int poll(struct pollfd *pollfds, int npollfds, int timeout);
+
+#endif
Index: eggdrop1.7/lib/eggdrop/eggdns.c
diff -u eggdrop1.7/lib/eggdrop/eggdns.c:1.1 eggdrop1.7/lib/eggdrop/eggdns.c:1.2
--- eggdrop1.7/lib/eggdrop/eggdns.c:1.1	Thu Sep 19 21:06:25 2002
+++ eggdrop1.7/lib/eggdrop/eggdns.c	Fri Sep 20 15:18:22 2002
@@ -365,7 +365,6 @@
 int egg_dns_cancel(int id, int issue_callback)
 {
 	dns_query_t *q, *prev;
-	FILE *fp;
 
 	prev = NULL;
 	for (q = query_head; q; q = q->next) {
Index: eggdrop1.7/lib/eggdrop/module.h
diff -u eggdrop1.7/lib/eggdrop/module.h:1.28 eggdrop1.7/lib/eggdrop/module.h:1.29
--- eggdrop1.7/lib/eggdrop/module.h:1.28	Thu Sep 19 21:06:25 2002
+++ eggdrop1.7/lib/eggdrop/module.h	Fri Sep 20 15:18:22 2002
@@ -20,7 +20,7 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 /*
- * $Id: module.h,v 1.28 2002/09/20 02:06:25 stdarg Exp $
+ * $Id: module.h,v 1.29 2002/09/20 20:18:22 stdarg Exp $
  */
 
 #ifndef _EGG_MOD_MODULE_H
@@ -64,7 +64,6 @@
 #include "src/traffic.h"
 #include "src/userent.h"
 #include "src/userrec.h"
-#include "src/tandem.h"
 #include "src/logfile.h"
 #include "src/dns.h"
 
Index: eggdrop1.7/lib/eggdrop/my_socket.c
diff -u eggdrop1.7/lib/eggdrop/my_socket.c:1.1 eggdrop1.7/lib/eggdrop/my_socket.c:1.2
--- eggdrop1.7/lib/eggdrop/my_socket.c:1.1	Thu Sep 19 21:10:33 2002
+++ eggdrop1.7/lib/eggdrop/my_socket.c	Fri Sep 20 15:18:22 2002
@@ -10,6 +10,11 @@
 
 #include "my_socket.h"
 
+/* Apparently SHUT_RDWR is not defined on some systems. */
+#ifndef SHUT_RDWR
+#define SHUT_RDWR 2
+#endif
+
 #ifdef AF_INET6
 #define DO_IPV6
 #endif
Index: eggdrop1.7/modules/Makefile.am
diff -u eggdrop1.7/modules/Makefile.am:1.5 eggdrop1.7/modules/Makefile.am:1.6
--- eggdrop1.7/modules/Makefile.am:1.5	Thu Sep 19 21:06:25 2002
+++ eggdrop1.7/modules/Makefile.am	Fri Sep 20 15:18:22 2002
@@ -1,6 +1,6 @@
-# $Id: Makefile.am,v 1.5 2002/09/20 02:06:25 stdarg Exp $
+# $Id: Makefile.am,v 1.6 2002/09/20 20:18:22 stdarg Exp $
 
 # FIXME: list will prolly become dynamic
-SUBDIRS			= blowfish compress console notes perlscript server tclscript javascript
+SUBDIRS			= blowfish compress console perlscript server tclscript javascript
 
 MAINTAINERCLEANFILES	= Makefile.in
Index: eggdrop1.7/modules/server/binds.h
diff -u /dev/null eggdrop1.7/modules/server/binds.h:1.1
--- /dev/null	Fri Sep 20 15:18:32 2002
+++ eggdrop1.7/modules/server/binds.h	Fri Sep 20 15:18:22 2002
@@ -0,0 +1,18 @@
+#ifndef _SERVER_BINDS_H_
+#define _SERVER_BINDS_H_
+
+extern bind_table_t *BT_wall,
+	*BT_raw,
+	*BT_new_raw,
+	*BT_notice,
+	*BT_msg,
+	*BT_msgm,
+	*BT_pub,
+	*BT_pubm,
+	*BT_ctcp,
+	*BT_ctcr;
+
+extern void server_binds_destroy();
+extern void server_binds_init();
+
+#endif
----------------------- End of diff -----------------------



More information about the Changes mailing list