[cvslog] (2006-01-06 03:59:40 UTC) Module eggdrop1.9: Change committed!

cvslog cvs at tsss.org
Thu Jan 5 21:59:40 CST 2006


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.9
Commit time: 2006-01-06 03:59:40 UTC
Commited by: sven

Modified files:
     lib/eggdrop/users.c src/main.c src/terminal.c src/terminal.h

Log message:

 * lots of memory corrupting .restart fun

---------------------- diff included ----------------------
Index: eggdrop1.9/lib/eggdrop/users.c
diff -u eggdrop1.9/lib/eggdrop/users.c:1.48 eggdrop1.9/lib/eggdrop/users.c:1.49
--- eggdrop1.9/lib/eggdrop/users.c:1.48	Thu Dec  1 15:22:11 2005
+++ eggdrop1.9/lib/eggdrop/users.c	Thu Jan  5 21:59:30 2006
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: users.c,v 1.48 2005-12-01 21:22:11 stdarg Exp $";
+static const char rcsid[] = "$Id: users.c,v 1.49 2006-01-06 03:59:30 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -98,15 +98,15 @@
 
 int user_shutdown(void)
 {
-	bind_table_del(BT_udelete);
-	bind_table_del(BT_uset);
-	bind_table_del(BT_uflags);
-
 	hash_table_walk(uid_ht, userlist_delete_walker, NULL);
 
 	/* flush any pending user delete events */
 	garbage_run();
 
+	bind_table_del(BT_udelete);
+	bind_table_del(BT_uset);
+	bind_table_del(BT_uflags);
+
 	hash_table_delete(irchost_cache_ht);
 	hash_table_delete(uid_ht);
 	hash_table_delete(handle_ht);
Index: eggdrop1.9/src/main.c
diff -u eggdrop1.9/src/main.c:1.187 eggdrop1.9/src/main.c:1.188
--- eggdrop1.9/src/main.c:1.187	Sat May  7 23:40:13 2005
+++ eggdrop1.9/src/main.c	Thu Jan  5 21:59:30 2006
@@ -19,7 +19,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: main.c,v 1.187 2005-05-08 04:40:13 stdarg Exp $";
+static const char rcsid[] = "$Id: main.c,v 1.188 2006-01-06 03:59:30 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>
@@ -354,8 +354,8 @@
 	user_save(core_config.userfile);
 
 	/* destroy terminal */
-	if (terminal_mode && runmode != RUNMODE_RESTART)
-		terminal_shutdown();
+	if (terminal_mode)
+		terminal_shutdown(runmode);
 
 	/* unload core help */
 	//help_unload_by_module("core");
@@ -603,8 +603,8 @@
 	/* start terminal */
 	if (runmode != RUNMODE_RESTART) {
 		if (backgrd) bg_finish_split();
-		if (terminal_mode) terminal_init();
 	}
+	if (terminal_mode) terminal_init();
 
 	return (0);
 }
Index: eggdrop1.9/src/terminal.c
diff -u eggdrop1.9/src/terminal.c:1.5 eggdrop1.9/src/terminal.c:1.6
--- eggdrop1.9/src/terminal.c:1.5	Wed Jun 23 16:12:57 2004
+++ eggdrop1.9/src/terminal.c	Thu Jan  5 21:59:30 2006
@@ -18,7 +18,7 @@
  */
 
 #ifndef lint
-static const char rcsid[] = "$Id: terminal.c,v 1.5 2004-06-23 21:12:57 stdarg Exp $";
+static const char rcsid[] = "$Id: terminal.c,v 1.6 2006-01-06 03:59:30 sven Exp $";
 #endif
 
 #include <eggdrop/eggdrop.h>			/* partyline_*		*/
@@ -72,13 +72,13 @@
 
 	/* Connect an idx to stdin. */
 	terminal_session.in_idx = sockbuf_new();
-	sockbuf_set_sock(terminal_session.in_idx, fileno(stdin), SOCKBUF_CLIENT);
+	sockbuf_set_sock(terminal_session.in_idx, dup(fileno(stdin)), SOCKBUF_CLIENT);
 	sockbuf_set_handler(terminal_session.in_idx, &terminal_sockbuf_handler, NULL);
 	linemode_on(terminal_session.in_idx);
 
 	/* And one for stdout. */
 	terminal_session.out_idx = sockbuf_new();
-	sockbuf_set_sock(terminal_session.out_idx, fileno(stdout), SOCKBUF_NOREAD);
+	sockbuf_set_sock(terminal_session.out_idx, dup(fileno(stdout)), SOCKBUF_NOREAD);
 
 	putlog(LOG_MISC, "*", _("Entering terminal mode."));
 
@@ -92,9 +92,16 @@
 	return (0);
 }
 
-int terminal_shutdown(void)
+#define RUNMODE_RESTART 3
+
+int terminal_shutdown(int runmode)
 {
-        if (terminal_session.party) {
+	if (runmode == RUNMODE_RESTART) {
+		terminal_user = NULL;
+		return(0);
+	}
+
+	if (terminal_session.party) {
 		partymember_delete(terminal_session.party, _("Shutdown"));
 		terminal_session.party = NULL;
 	}
Index: eggdrop1.9/src/terminal.h
diff -u eggdrop1.9/src/terminal.h:1.3 eggdrop1.9/src/terminal.h:1.4
--- eggdrop1.9/src/terminal.h:1.3	Tue Jun 22 15:12:37 2004
+++ eggdrop1.9/src/terminal.h	Thu Jan  5 21:59:30 2006
@@ -16,7 +16,7 @@
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  *
- * $Id: terminal.h,v 1.3 2004-06-22 20:12:37 wingman Exp $
+ * $Id: terminal.h,v 1.4 2006-01-06 03:59:30 sven Exp $
  */
 #ifndef _EGG_TERMINAL_H
 #define _EGG_TERMINAL_H
@@ -28,6 +28,6 @@
 #define TERMINAL_HOST	"terminal"
 
 int terminal_init(void);
-int terminal_shutdown(void);
+int terminal_shutdown(int runmode);
 
 #endif /* _EGG_TERMINAL_H */
----------------------- End of diff -----------------------



More information about the Changes mailing list