This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
reenable fake signal handling on Windows, bugs and all
authorGurusamy Sarathy <gsar@cpan.org>
Wed, 17 May 2000 02:24:56 +0000 (02:24 +0000)
committerGurusamy Sarathy <gsar@cpan.org>
Wed, 17 May 2000 02:24:56 +0000 (02:24 +0000)
p4raw-id: //depot/perl@6108

mg.c
perl.h
win32/perlhost.h

diff --git a/mg.c b/mg.c
index 0892511..f0b5734 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -2100,7 +2100,11 @@ static SV* sig_sv;
 Signal_t
 Perl_sighandler(int sig)
 {
+#if defined(WIN32) && defined(PERL_IMPLICIT_CONTEXT)
+    dTHXoa(PL_curinterp);      /* fake TLS, because signals don't do TLS */
+#else
     dTHX;
+#endif
     dSP;
     GV *gv = Nullgv;
     HV *st;
@@ -2110,6 +2114,10 @@ Perl_sighandler(int sig)
     U32 flags = 0;
     I32 o_save_i = PL_savestack_ix;
     XPV *tXpv = PL_Xpv;
+
+#if defined(WIN32) && defined(PERL_IMPLICIT_CONTEXT)
+    PERL_SET_THX(aTHXo);       /* fake TLS, see above */
+#endif
     
     if (PL_savestack_ix + 15 <= PL_savestack_max)
        flags |= 1;
diff --git a/perl.h b/perl.h
index 2f5a560..8068381 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -242,6 +242,7 @@ struct perl_thread;
 #  define aTHXo                aTHX
 #  define aTHXo_       aTHX_
 #  define dTHXo                dTHX
+#  define dTHXoa(x)    dTHXa(x)
 #endif
 
 #ifndef pTHXx
index 51e125b..ea0d31d 100644 (file)
@@ -10,6 +10,7 @@
 #ifndef ___PerlHost_H___
 #define ___PerlHost_H___
 
+#include <signal.h>
 #include "iperlsys.h"
 #include "vmem.h"
 #include "vdir.h"
@@ -1639,7 +1640,7 @@ PerlProcWaitpid(struct IPerlProc* piPerl, int pid, int *status, int flags)
 Sighandler_t
 PerlProcSignal(struct IPerlProc* piPerl, int sig, Sighandler_t subcode)
 {
-    return 0;
+    return signal(sig, subcode);
 }
 
 #ifdef USE_ITHREADS