[cvslog] [CVS] Module eggdrop1.8: Change committed

cvs at eggheads.org cvs at eggheads.org
Wed Jan 26 19:41:18 CST 2011


CVSROOT    : /usr/local/cvsroot
Module     : eggdrop1.8
Commit time: 2011-01-27 01:41:18 UTC
Committer  : Thomas Sader <thommey at gmail.com>

Modified files:
     doc/Changes1.8 src/main.c src/tclhash.c src/tclhash.h

Log message:

bind evnt return value now ignored for non-signal events as documented

---------------------- diff included ----------------------
Index: eggdrop1.8/doc/Changes1.8
diff -u eggdrop1.8/doc/Changes1.8:1.42 eggdrop1.8/doc/Changes1.8:1.43
--- eggdrop1.8/doc/Changes1.8:1.42	Thu Jan 20 20:37:03 2011
+++ eggdrop1.8/doc/Changes1.8	Wed Jan 26 19:41:08 2011
@@ -1,4 +1,4 @@
-$Id: Changes1.8,v 1.42 2011/01/21 02:37:03 thommey Exp $
+$Id: Changes1.8,v 1.43 2011/01/27 01:41:08 thommey Exp $
 
 Eggdrop Changes (since version 1.8.0)
 
@@ -6,6 +6,9 @@
 
 1.8.0 (CVS):
 
+  - bind evnt return value now ignored for non-signal events as documented
+    Found by: Robby / Patch by: thommey
+
   - Reran autotools
   - Clarified --with-tcl* usage in configure and mentioned tcl-dev packages.
   - Fixed some section numbering in doc/COMPILE-GUIDE.
Index: eggdrop1.8/src/main.c
diff -u eggdrop1.8/src/main.c:1.6 eggdrop1.8/src/main.c:1.7
--- eggdrop1.8/src/main.c:1.6	Sat Oct 23 05:16:12 2010
+++ eggdrop1.8/src/main.c	Wed Jan 26 19:41:08 2011
@@ -5,7 +5,7 @@
  *   command line arguments
  *   context and assert debugging
  *
- * $Id: main.c,v 1.6 2010/10/23 11:16:12 pseudo Exp $
+ * $Id: main.c,v 1.7 2011/01/27 01:41:08 thommey Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -382,14 +382,14 @@
   /* Now we die by default on sigterm, but scripts have the chance to
    * catch the event themselves and cancel shutdown by returning 1
    */
-  if (check_tcl_event("sigterm"))
+  if (check_tcl_signal("sigterm"))
     return;
   kill_bot("ACK, I've been terminated!", "TERMINATE SIGNAL -- SIGNING OFF");
 }
 
 static void got_quit(int z)
 {
-  if (check_tcl_event("sigquit"))
+  if (check_tcl_signal("sigquit"))
     return;
   putlog(LOG_MISC, "*", "Received QUIT signal: restarting...");
   do_restart = -1;
@@ -399,7 +399,7 @@
 static void got_hup(int z)
 {
   write_userfile(-1);
-  if (check_tcl_event("sighup"))
+  if (check_tcl_signal("sighup"))
     return;
   putlog(LOG_MISC, "*", "Received HUP signal: rehashing...");
   do_restart = -2;
@@ -419,7 +419,7 @@
  */
 static void got_ill(int z)
 {
-  check_tcl_event("sigill");
+  check_tcl_signal("sigill");
 #ifdef DEBUG_CONTEXT
   putlog(LOG_MISC, "*", "* Context: %s/%d [%s]", cx_file[cx_ptr],
          cx_line[cx_ptr], (cx_note[cx_ptr][0]) ? cx_note[cx_ptr] : "");
Index: eggdrop1.8/src/tclhash.c
diff -u eggdrop1.8/src/tclhash.c:1.3 eggdrop1.8/src/tclhash.c:1.4
--- eggdrop1.8/src/tclhash.c:1.3	Sat Oct 23 05:16:13 2010
+++ eggdrop1.8/src/tclhash.c	Wed Jan 26 19:41:08 2011
@@ -7,7 +7,7 @@
  *   (non-Tcl) procedure lookups for msg/dcc/file commands
  *   (Tcl) binding internal procedures to msg/dcc/file commands
  *
- * $Id: tclhash.c,v 1.3 2010/10/23 11:16:13 pseudo Exp $
+ * $Id: tclhash.c,v 1.4 2011/01/27 01:41:08 thommey Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -1181,13 +1181,20 @@
                  MATCH_CRON | BIND_STACKABLE);
 }
 
-int check_tcl_event(const char *event)
+void check_tcl_event(const char *event)
+{
+  Tcl_SetVar(interp, "_event1", (char *) event, 0);
+  check_tcl_bind(H_event, event, 0, " $_event1",
+                 MATCH_EXACT | BIND_STACKABLE);
+}
+
+int check_tcl_signal(const char *event)
 {
   int x;
 
   Tcl_SetVar(interp, "_event1", (char *) event, 0);
   x = check_tcl_bind(H_event, event, 0, " $_event1",
-                 MATCH_EXACT | BIND_STACKABLE | BIND_WANTRET);
+                 MATCH_EXACT | BIND_STACKABLE | BIND_STACKRET);
   return (x == BIND_EXEC_LOG);
 }
 
Index: eggdrop1.8/src/tclhash.h
diff -u eggdrop1.8/src/tclhash.h:1.3 eggdrop1.8/src/tclhash.h:1.4
--- eggdrop1.8/src/tclhash.h:1.3	Sat Oct 23 05:16:13 2010
+++ eggdrop1.8/src/tclhash.h	Wed Jan 26 19:41:08 2011
@@ -1,7 +1,7 @@
 /*
  * tclhash.h
  *
- * $Id: tclhash.h,v 1.3 2010/10/23 11:16:13 pseudo Exp $
+ * $Id: tclhash.h,v 1.4 2011/01/27 01:41:08 thommey Exp $
  */
 /*
  * Copyright (C) 1997 Robey Pointer
@@ -102,7 +102,8 @@
 void check_tcl_nkch(const char *, const char *);
 void check_tcl_away(const char *, int, const char *);
 void check_tcl_chatactbcst(const char *, int, const char *, tcl_bind_list_t *);
-int check_tcl_event(const char *);
+void check_tcl_event(const char *);
+int check_tcl_signal(const char *);
 void check_tcl_die(char *);
 void check_tcl_log(int, char *, char *);
 #ifdef TLS
----------------------- End of diff -----------------------


More information about the Changes mailing list