Change 33802 by [EMAIL PROTECTED] on 2008/05/10 14:15:40

        Integrate:
        [ 33665]
        Subject: [PATCH] is_gv_magical correctly check "ISA"
        From: Gerard Goossen <[EMAIL PROTECTED]>
        Date: Wed, 9 Apr 2008 12:12:44 +0200
        Message-ID: <[EMAIL PROTECTED]>
        
        [ 33741]
        Inline the trivial S_raise_signal function in the perl signal handler.
        
        This makes the code more readable and avoids the need for excuses
        for why the function is (still) named this way.
        
        It also effectively avoids segfaults observed with gcc-3.3 when
        the sibling-call optimization is used for invoking S_raise_signal()
        just before the signal handler returns.
        
        [ 33762]
        Cast the result of fpsetmask(0) to (void), as some implementations
        expand it via a macro, with a comma expression to calculate the return
        value, at which point gcc has the gall to warn that an expression
        calcualted is not used.
        Blame SCO for having to have fpsetmask(0) in the code to start with.
        
        [ 33763]
        Subject: [PATCH] Win32 process ids can have more than 16 bits
        From: "Jan Dubois" <[EMAIL PROTECTED]>
        Date: Tue, 29 Apr 2008 01:14:39 -0700
        Message-ID: <[EMAIL PROTECTED]>
        
        [ 33788]
        Record-style reads in Perl_sv_gets have to be done with read(), not
        fread() on VMS, and have been for some time.  Except that ain't gonna
        work with PerlIO::Scalar's in-memory files.  Old bug exposed by new 
        test in #33769.

Affected files ...

... //depot/maint-5.10/perl/gv.c#3 integrate
... //depot/maint-5.10/perl/mg.c#7 integrate
... //depot/maint-5.10/perl/perl.h#10 integrate
... //depot/maint-5.10/perl/sv.c#13 integrate
... //depot/maint-5.10/perl/win32/win32.c#6 integrate

Differences ...

==== //depot/maint-5.10/perl/gv.c#3 (text) ====
Index: perl/gv.c
--- perl/gv.c#2~33139~  2008-01-30 15:19:42.000000000 -0800
+++ perl/gv.c   2008-05-10 07:15:40.000000000 -0700
@@ -2157,7 +2157,7 @@
        const char * const name1 = name + 1;
        switch (*name) {
        case 'I':
-           if (len == 3 && name1[1] == 'S' && name[2] == 'A')
+           if (len == 3 && name[1] == 'S' && name[2] == 'A')
                goto yes;
            break;
        case 'O':

==== //depot/maint-5.10/perl/mg.c#7 (text) ====
Index: perl/mg.c
--- perl/mg.c#6~33641~  2008-04-03 09:39:03.000000000 -0700
+++ perl/mg.c   2008-05-10 07:15:40.000000000 -0700
@@ -1277,35 +1277,6 @@
     return 0;
 }
 
-/*
- * The signal handling nomenclature has gotten a bit confusing since the 
advent of
- * safe signals.  S_raise_signal only raises signals by analogy with what the 
- * underlying system's signal mechanism does.  It might be more proper to say 
that
- * it defers signals that have already been raised and caught.  
- *
- * PL_sig_pending and PL_psig_pend likewise do not track signals that are 
pending 
- * in the sense of being on the system's signal queue in between raising and 
delivery.  
- * They are only pending on Perl's deferral list, i.e., they track deferred 
signals 
- * awaiting delivery after the current Perl opcode completes and say nothing 
about
- * signals raised but not yet caught in the underlying signal implementation.
- */
-
-#ifndef SIG_PENDING_DIE_COUNT
-#  define SIG_PENDING_DIE_COUNT 120
-#endif
-
-static void
-S_raise_signal(pTHX_ int sig)
-{
-    dVAR;
-    /* Set a flag to say this signal is pending */
-    PL_psig_pend[sig]++;
-    /* And one to say _a_ signal is pending */
-    if (++PL_sig_pending >= SIG_PENDING_DIE_COUNT)
-       Perl_croak(aTHX_ "Maximal count of pending signals (%lu) exceeded",
-               (unsigned long)SIG_PENDING_DIE_COUNT);
-}
-
 Signal_t
 #if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
 Perl_csighandler(int sig, siginfo_t *sip PERL_UNUSED_DECL, void *uap 
PERL_UNUSED_DECL)
@@ -1334,7 +1305,7 @@
 #endif
 #if defined(HAS_SIGACTION) && defined(SA_SIGINFO)
 #endif
-   if (
+    if (
 #ifdef SIGILL
           sig == SIGILL ||
 #endif
@@ -1352,8 +1323,19 @@
 #else
        (*PL_sighandlerp)(sig);
 #endif
-   else
-       S_raise_signal(aTHX_ sig);
+    else {
+       /* Set a flag to say this signal is pending, that is awaiting delivery 
after
+        * the current Perl opcode completes */
+       PL_psig_pend[sig]++;
+
+#ifndef SIG_PENDING_DIE_COUNT
+#  define SIG_PENDING_DIE_COUNT 120
+#endif
+       /* And one to say _a_ signal is pending */
+       if (++PL_sig_pending >= SIG_PENDING_DIE_COUNT)
+           Perl_croak(aTHX_ "Maximal count of pending signals (%lu) exceeded",
+                      (unsigned long)SIG_PENDING_DIE_COUNT);
+    }
 }
 
 #if defined(FAKE_PERSISTENT_SIGNAL_HANDLERS) || 
defined(FAKE_DEFAULT_SIGNAL_HANDLERS)

==== //depot/maint-5.10/perl/perl.h#10 (text) ====
Index: perl/perl.h
--- perl/perl.h#9~33611~        2008-03-31 05:32:56.000000000 -0700
+++ perl/perl.h 2008-05-10 07:15:40.000000000 -0700
@@ -2654,7 +2654,11 @@
 #    if HAS_FLOATINGPOINT_H
 #      include <floatingpoint.h>
 #    endif
-#    define PERL_FPU_INIT fpsetmask(0)
+/* Some operating systems have this as a macro, which in turn expands to a 
comma
+   expression, and the last sub-expression is something that gets calculated,
+   and then they have the gall to warn that a value computed is not used. Hence
+   cast to void.  */
+#    define PERL_FPU_INIT (void)fpsetmask(0)
 #  else
 #    if defined(SIGFPE) && defined(SIG_IGN) && !defined(PERL_MICRO)
 #      define PERL_FPU_INIT       PL_sigfpe_saved = (Sighandler_t) 
signal(SIGFPE, SIG_IGN)

==== //depot/maint-5.10/perl/sv.c#13 (text) ====
Index: perl/sv.c
--- perl/sv.c#12~33745~ 2008-04-24 20:30:37.000000000 -0700
+++ perl/sv.c   2008-05-10 07:15:40.000000000 -0700
@@ -6353,6 +6353,9 @@
       I32 bytesread;
       char *buffer;
       U32 recsize;
+#ifdef VMS
+      int fd;
+#endif
 
       /* Grab the size of the record we're getting */
       recsize = SvUV(SvRV(PL_rs)); /* RsRECORD() guarantees > 0. */
@@ -6364,7 +6367,13 @@
       /* doing, but we've got no other real choice - except avoid stdio
          as implementation - perhaps write a :vms layer ?
        */
-      bytesread = PerlLIO_read(PerlIO_fileno(fp), buffer, recsize);
+      fd = PerlIO_fileno(fp);
+      if (fd == -1) { /* in-memory file from PerlIO::Scalar */
+          bytesread = PerlIO_read(fp, buffer, recsize);
+      }
+      else {
+          bytesread = PerlLIO_read(fd, buffer, recsize);
+      }
 #else
       bytesread = PerlIO_read(fp, buffer, recsize);
 #endif

==== //depot/maint-5.10/perl/win32/win32.c#6 (text) ====
Index: perl/win32/win32.c
--- perl/win32/win32.c#5~33590~ 2008-03-28 12:01:33.000000000 -0700
+++ perl/win32/win32.c  2008-05-10 07:15:40.000000000 -0700
@@ -663,8 +663,7 @@
     }
 
     if (flag == P_NOWAIT) {
-       if (IsWin95())
-           PL_statusvalue = -1;        /* >16bits hint for pp_system() */
+       PL_statusvalue = -1;    /* >16bits hint for pp_system() */
     }
     else {
        if (status < 0) {
@@ -777,8 +776,7 @@
        Safefree(argv);
     }
     if (exectype == EXECF_SPAWN_NOWAIT) {
-       if (IsWin95())
-           PL_statusvalue = -1;        /* >16bits hint for pp_system() */
+       PL_statusvalue = -1;    /* >16bits hint for pp_system() */
     }
     else {
        if (status < 0) {
End of Patch.

Reply via email to