[NeoStats-Devel] [Commits] r2802 - trunk/src
[email protected] Mon, 12 Sep 2005 23:07:50 +1000
| Newsgroups | gmane.comp.neostats.devel |
|---|---|
| Message-ID | <[email protected]> |
Author: Fish
Date: Mon Sep 12 21:07:43 2005
New Revision: 2802
Modified:
trunk/src/nsevents.c
trunk/src/perl.c
Log:
Fix a crazy crash on perl events
Modified: trunk/src/nsevents.c
==============================================================================
--- trunk/src/nsevents.c (original)
+++ trunk/src/nsevents.c Mon Sep 12 21:07:43 2005
@@ -295,7 +295,7 @@
dlog( DEBUG5, "AddEvent: adding %s to %s", EventStrings[eventptr->event], mod_ptr->info->name );
/* only standard modules have a handler, perl mods use a custom callback */
- if (!eventptr->pe) {
+ if (!eventptr->flags & EVENT_FLAG_PERLCALL) {
if(!eventptr->handler )
{
nlog( LOG_ERROR, "AddEvent: missing handler for %s in module %s", EventStrings[eventptr->event], mod_ptr->info->name );
Modified: trunk/src/perl.c
==============================================================================
--- trunk/src/perl.c (original)
+++ trunk/src/perl.c Mon Sep 12 21:07:43 2005
@@ -461,6 +461,8 @@
evt->pe = ns_calloc(sizeof(PerlEvent));
evt->event = (int) SvIV (ST (0));
evt->flags = (int) SvIV (ST (1));
+ /* its a perl callback */
+ evt->flags |= EVENT_FLAG_PERLCALL;
/* null, because its a perl event, which will execute via dedicated perl event handler */
evt->handler = NULL;
evt->pe->callback = sv_mortalcopy(ST (2));