Regenerate META.yml
[p5sagit/p5-mst-13.2.git] / doio.c
diff --git a/doio.c b/doio.c
index e1acc67..fbd1910 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -176,7 +176,7 @@ Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw,
 
         IoTYPE(io) = PerlIO_intmode2str(rawmode, &mode[ix], &writing);
 
-       namesv = sv_2mortal(newSVpv(oname,0));
+       namesv = sv_2mortal(newSVpvn(oname,len));
        num_svs = 1;
        svp = &namesv;
        type = NULL;
@@ -259,9 +259,9 @@ Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw,
            mode[0] = 'w';
            writing = 1;
             if (out_raw)
-                my_strlcat(mode, "b", PERL_MODE_MAX - 1);
+               mode[1] = 'b';
             else if (out_crlf)
-                my_strlcat(mode, "t", PERL_MODE_MAX - 1); 
+               mode[1] = 't';
            if (num_svs > 1) {
                fp = PerlProc_popen_list(mode, num_svs, svp);
            }
@@ -290,9 +290,9 @@ Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw,
            writing = 1;
 
             if (out_raw)
-                my_strlcat(mode, "b", PERL_MODE_MAX - 1);
+               mode[1] = 'b';
             else if (out_crlf)
-                my_strlcat(mode, "t", PERL_MODE_MAX - 1);
+               mode[1] = 't';
            if (*type == '&') {
              duplicity:
                dodup = PERLIO_DUP_FD;
@@ -416,9 +416,9 @@ Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw,
            } while (isSPACE(*type));
            mode[0] = 'r';
             if (in_raw)
-                my_strlcat(mode, "b", PERL_MODE_MAX - 1);
+               mode[1] = 'b';
             else if (in_crlf)
-                my_strlcat(mode, "t", PERL_MODE_MAX - 1);
+               mode[1] = 't';
            if (*type == '&') {
                goto duplicity;
            }
@@ -470,9 +470,9 @@ Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw,
            mode[0] = 'r';
 
             if (in_raw)
-                my_strlcat(mode, "b", PERL_MODE_MAX - 1);
+               mode[1] = 'b';
             else if (in_crlf)
-                my_strlcat(mode, "t", PERL_MODE_MAX - 1);
+               mode[1] = 't';
 
            if (num_svs > 1) {
                fp = PerlProc_popen_list(mode,num_svs,svp);
@@ -501,9 +501,9 @@ Perl_do_openn(pTHX_ GV *gv, register const char *oname, I32 len, int as_raw,
            mode[0] = 'r';
 
             if (in_raw)
-                my_strlcat(mode, "b", PERL_MODE_MAX - 1);
+               mode[1] = 'b';
             else if (in_crlf)
-                my_strlcat(mode, "t", PERL_MODE_MAX - 1);
+               mode[1] = 't';
 
            if (*name == '-' && name[1] == '\0') {
                fp = PerlIO_stdin();
@@ -1274,17 +1274,7 @@ Perl_my_stat(pTHX)
            if (IoIFP(io)) {
                return (PL_laststatval = PerlLIO_fstat(PerlIO_fileno(IoIFP(io)), &PL_statcache));
             } else if (IoDIRP(io)) {
-#ifdef HAS_DIRFD
-                return (PL_laststatval = PerlLIO_fstat(dirfd(IoDIRP(io)), &PL_statcache));
-#else
-                Perl_die(aTHX_ PL_no_func, "dirfd");
-               /* NOT REACHED */
-               return 0;
-               /* Can't use NORETURN_FUNCTION_END because Perl_die is not
-                *     __attribute__noreturn__
-                * Can't use DIE because that does not return an integer
-                */
-#endif
+                return (PL_laststatval = PerlLIO_fstat(my_dirfd(IoDIRP(io)), &PL_statcache));
             } else {
                 if (ckWARN2(WARN_UNOPENED,WARN_CLOSED))
                     report_evil_fh(gv, io, PL_op->op_type);
@@ -1390,7 +1380,7 @@ Perl_do_aexec5(pTHX_ SV *really, register SV **mark, register SV **sp,
               int fd, int do_report)
 {
     dVAR;
-#if defined(MACOS_TRADITIONAL) || defined(__SYMBIAN32__)
+#if defined(MACOS_TRADITIONAL) || defined(__SYMBIAN32__) || defined(__LIBCATAMOUNT__)
     Perl_croak(aTHX_ "exec? I'm not *that* kind of operating system");
 #else
     if (sp > mark) {
@@ -1449,7 +1439,7 @@ Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report)
     const Size_t cmdlen = strlen(incmd) + 1;
     Newx(buf, cmdlen, char);
     cmd = buf;
-    my_strlcpy(cmd, incmd, cmdlen);
+    memcpy(cmd, incmd, cmdlen);
 
     while (*cmd && isSPACE(*cmd))
        cmd++;
@@ -1609,7 +1599,7 @@ Perl_apply(pTHX_ I32 type, register SV **mark, register SV **sp)
     case OP_CHMOD:
        APPLY_TAINT_PROPER();
        if (++mark <= sp) {
-           val = SvIVx(*mark);
+           val = SvIV(*mark);
            APPLY_TAINT_PROPER();
            tot = sp - mark;
            while (++mark <= sp) {
@@ -1703,7 +1693,7 @@ nothing in the core.
                Perl_croak(aTHX_ "Unrecognized signal name \"%s\"",s);
        }
        else
-           val = SvIVx(*mark);
+           val = SvIV(*mark);
        APPLY_TAINT_PROPER();
        tot = sp - mark;
 #ifdef VMS
@@ -1716,7 +1706,7 @@ nothing in the core.
             * CRTL's emulation of Unix-style signals and kill()
             */
            while (++mark <= sp) {
-               I32 proc = SvIVx(*mark);
+               I32 proc = SvIV(*mark);
                register unsigned long int __vmssts;
                APPLY_TAINT_PROPER();
                if (!((__vmssts = sys$delprc(&proc,0)) & 1)) {
@@ -1740,7 +1730,7 @@ nothing in the core.
        if (val < 0) {
            val = -val;
            while (++mark <= sp) {
-               const I32 proc = SvIVx(*mark);
+               const I32 proc = SvIV(*mark);
                APPLY_TAINT_PROPER();
 #ifdef HAS_KILLPG
                if (PerlProc_killpg(proc,val))  /* BSD */
@@ -1752,7 +1742,7 @@ nothing in the core.
        }
        else {
            while (++mark <= sp) {
-               const I32 proc = SvIVx(*mark);
+               const I32 proc = SvIV(*mark);
                APPLY_TAINT_PROPER();
                if (PerlProc_kill(proc, val))
                    tot--;
@@ -1810,16 +1800,16 @@ nothing in the core.
            else {
                 Zero(&utbuf, sizeof utbuf, char);
 #ifdef HAS_FUTIMES
-               utbuf[0].tv_sec = (long)SvIVx(accessed);  /* time accessed */
+               utbuf[0].tv_sec = (long)SvIV(accessed);  /* time accessed */
                utbuf[0].tv_usec = 0;
-               utbuf[1].tv_sec = (long)SvIVx(modified);  /* time modified */
+               utbuf[1].tv_sec = (long)SvIV(modified);  /* time modified */
                utbuf[1].tv_usec = 0;
 #elif defined(BIG_TIME)
-                utbuf.actime = (Time_t)SvNVx(accessed);  /* time accessed */
-                utbuf.modtime = (Time_t)SvNVx(modified); /* time modified */
+                utbuf.actime = (Time_t)SvNV(accessed);  /* time accessed */
+                utbuf.modtime = (Time_t)SvNV(modified); /* time modified */
 #else
-                utbuf.actime = (Time_t)SvIVx(accessed);  /* time accessed */
-                utbuf.modtime = (Time_t)SvIVx(modified); /* time modified */
+                utbuf.actime = (Time_t)SvIV(accessed);  /* time accessed */
+                utbuf.modtime = (Time_t)SvIV(modified); /* time modified */
 #endif
             }
            APPLY_TAINT_PROPER();
@@ -2259,7 +2249,7 @@ Perl_do_shmio(pTHX_ I32 optype, SV **mark, SV **sp)
     if (shm == (char *)-1)     /* I hate System V IPC, I really do */
        return -1;
     if (optype == OP_SHMREAD) {
-       const char *mbuf;
+       char *mbuf;
        /* suppress warning when reading into undef var (tchrist 3/Mar/00) */
        if (! SvOK(mstr))
            sv_setpvn(mstr, "", 0);