This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Cleanup #18770 as suggested by Rafael.
authorJarkko Hietaniemi <jhi@iki.fi>
Tue, 25 Feb 2003 07:46:53 +0000 (07:46 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Tue, 25 Feb 2003 07:46:53 +0000 (07:46 +0000)
p4raw-id: //depot/perl@18771

mg.c
perl.h

diff --git a/mg.c b/mg.c
index 116a369..58a5cd5 100644 (file)
--- a/mg.c
+++ b/mg.c
@@ -1158,21 +1158,6 @@ Perl_despatch_signals(pTHX)
     PL_sig_pending = 0;
     for (sig = 1; sig < SIG_SIZE; sig++) {
        if (PL_psig_pend[sig]) {
-#define PERL_BLOCK_SIGNALS
-#if defined(HAS_SIGPROCMASK) && defined(PERL_BLOCK_SIGNALS)
-            /* From sigaction(2) (FreeBSD man page):
-             * | Signal routines normally execute with the signal that
-             * | caused their invocation blocked, but other signals may
-             * | yet occur.
-             * Emulate this behavior.
-             */
-#   define PERL_BLOCKSIG_ADD(set,sig) \
-       sigset_t set; sigemptyset(&(set)); sigaddset(&(set), sig)
-#   define PERL_BLOCKSIG_BLOCK(set) \
-       sigprocmask(SIG_BLOCK, &(set), NULL)
-#   define PERL_BLOCKSIG_UNBLOCK(set) \
-       sigprocmask(SIG_UNBLOCK, &(set), NULL)
-#endif /* HAS_SIGPROCMASK && PERL_BLOCK_SIGNALS */
            PERL_BLOCKSIG_ADD(set, sig);
            PL_psig_pend[sig] = 0;
            PERL_BLOCKSIG_BLOCK(set);
diff --git a/perl.h b/perl.h
index d03809a..d316734 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -4201,6 +4201,36 @@ extern void moncontrol(int);
 
 #define PERL_SIGNALS_UNSAFE_FLAG       0x0001
 
+/* From sigaction(2) (FreeBSD man page):
+ * | Signal routines normally execute with the signal that
+ * | caused their invocation blocked, but other signals may
+ * | yet occur.
+ * Emulation of this behavior (from within Perl) is enabled
+ * by defining PERL_BLOCK_SIGNALS.
+ */
+#define PERL_BLOCK_SIGNALS
+
+#if defined(HAS_SIGPROCMASK) && defined(PERL_BLOCK_SIGNALS)
+#   define PERL_BLOCKSIG_ADD(set,sig) \
+       sigset_t set; sigemptyset(&(set)); sigaddset(&(set), sig)
+#   define PERL_BLOCKSIG_BLOCK(set) \
+       sigprocmask(SIG_BLOCK, &(set), NULL)
+#   define PERL_BLOCKSIG_UNBLOCK(set) \
+       sigprocmask(SIG_UNBLOCK, &(set), NULL)
+#endif /* HAS_SIGPROCMASK && PERL_BLOCK_SIGNALS */
+
+/* How about the old style of sigblock()? */
+
+#ifndef PERL_BLOCKSIG_ADD
+#   define PERL_BLOCKSIG_ADD(set, sig) NOOP
+#endif
+#ifndef PERL_BLOCKSIG_BLOCK
+#   define PERL_BLOCKSIG_BLOCK(set)    NOOP
+#endif
+#ifndef PERL_BLOCKSIG_ADD
+#   define PERL_BLOCKSIG_UNBLOCK(set)  NOOP
+#endif
+
 /* and finally... */
 #define PERL_PATCHLEVEL_H_IMPLICIT
 #include "patchlevel.h"