This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Use newSVpvn(), newSVpvs() and gv_fetchpvs(), the later with proper arguments.
authorNicholas Clark <nick@ccl4.org>
Thu, 15 Oct 2009 19:02:51 +0000 (20:02 +0100)
committerNicholas Clark <nick@ccl4.org>
Thu, 15 Oct 2009 20:27:49 +0000 (21:27 +0100)
Brought to you by the Campaign for the Elimination of strlen().

ext/POSIX/POSIX.xs

index 8572367..392ba12 100644 (file)
@@ -1217,7 +1217,7 @@ sigaction(sig, optaction, oldaction = 0)
        {
            dVAR;
            POSIX__SigAction action;
-           GV *siggv = gv_fetchpv("SIG", TRUE, SVt_PVHV);
+           GV *siggv = gv_fetchpvs("SIG", GV_ADD, SVt_PVHV);
            struct sigaction act;
            struct sigaction oact;
            sigset_t sset;
@@ -1280,7 +1280,7 @@ sigaction(sig, optaction, oldaction = 0)
                XSRETURN_UNDEF;
            ENTER;
            /* Restore signal mask no matter how we exit this block. */
-           osset_sv = newSVpv((char *)(&osset), sizeof(sigset_t));
+           osset_sv = newSVpvn((char *)(&osset), sizeof(sigset_t));
            SAVEFREESV( osset_sv );
            SAVEDESTRUCTOR_X(restore_sigmask, osset_sv);
 
@@ -1295,7 +1295,7 @@ sigaction(sig, optaction, oldaction = 0)
                        sv_setsv(*svp, *sigsvp);
                }
                else {
-                       sv_setpv(*svp, "DEFAULT");
+                       sv_setpvs(*svp, "DEFAULT");
                }
                RETVAL = sigaction(sig, (struct sigaction *)0, & oact);
                if(RETVAL == -1)