At the moment:

eval { exit };

won't exit under mp2, since our exit-but-don't-exit emulation is implemented via die "". I couldn't come up with any solution to make it internally and looking at the longjump and perl op logic in Perl_die_where is a foreign land to me. I suppose someone who understands that could come up with a better solution. Meanwhile I came up with a workaround:

   eval { exit };
   exit if $@ == -1; # rethrow exit

next replace -1 with a nice ModPerl::Const::EXIT (which doesn't yet exist), and we are done.

Here is the required change in the code:

Index: src/modules/perl/modperl_util.c
===================================================================
RCS file: /home/cvs/modperl-2.0/src/modules/perl/modperl_util.c,v
retrieving revision 1.66
diff -u -r1.66 modperl_util.c
--- src/modules/perl/modperl_util.c     3 Apr 2004 02:35:47 -0000       1.66
+++ src/modules/perl/modperl_util.c     30 Apr 2004 20:04:14 -0000
@@ -576,10 +576,16 @@
     ENTER;
     SAVESPTR(PL_diehook);
     PL_diehook = Nullsv;
+
     sv_setpv(ERRSV, "");
+    (void)SvUPGRADE(ERRSV, SVt_PVNV);
+    SvIVX(ERRSV) = -1;
+    SvIOK_on(ERRSV);
+
 #ifdef MP_PERL_5_6_0
     pat = ""; /* NULL segvs in 5.6.0 */
 #endif
+
     Perl_croak(aTHX_ pat);
 }

I'm using the same dual var $@ trick I'm using in the new exception handling trick.

What do you think? Any better ideas?

I'm not sure what ModPerl::Const::EXIT should be set to, some negative value? like -1000?

__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to