This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
D'oh! This has been moved to lib/Digest/t/digest.t but not deleted.
[perl5.git] / doio.c
diff --git a/doio.c b/doio.c
index 0c10519..5ba40b9 100644 (file)
--- a/doio.c
+++ b/doio.c
@@ -422,6 +422,8 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
                    fp = PerlIO_openn(aTHX_ type,mode,-1,0,0,NULL,num_svs,svp);
                }
            } /* !& */
+           if (!fp && type && *type && *type != ':' && !isIDFIRST(*type))
+              goto unknown_open_mode;
        } /* IoTYPE_WRONLY */
        else if (*type == IoTYPE_RDONLY) {
            /*SUPPRESS 530*/
@@ -453,6 +455,8 @@ Perl_do_openn(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
                }
                fp = PerlIO_openn(aTHX_ type,mode,-1,0,0,NULL,num_svs,svp);
            }
+           if (!fp && type && *type && *type != ':' && !isIDFIRST(*type))
+              goto unknown_open_mode;
        } /* IoTYPE_RDONLY */
        else if ((num_svs && /* '-|...' or '...|' */
                  type[0] == IoTYPE_STD && type[1] == IoTYPE_PIPE) ||
@@ -933,8 +937,8 @@ Perl_do_pipe(pTHX_ SV *sv, GV *rgv, GV *wgv)
 
     if (PerlProc_pipe(fd) < 0)
        goto badexit;
-    IoIFP(rstio) = PerlIO_fdopen(fd[0], "r"PIPESOCK_MODE);
-    IoOFP(wstio) = PerlIO_fdopen(fd[1], "w"PIPESOCK_MODE);
+    IoIFP(rstio) = PerlIO_fdopen(fd[0], "r"PIPE_OPEN_MODE);
+    IoOFP(wstio) = PerlIO_fdopen(fd[1], "w"PIPE_OPEN_MODE);
     IoOFP(rstio) = IoIFP(rstio);
     IoIFP(wstio) = IoOFP(wstio);
     IoTYPE(rstio) = IoTYPE_RDONLY;
@@ -1544,7 +1548,7 @@ Perl_do_exec3(pTHX_ char *cmd, int fd, int do_report)
 
                while (*t && isSPACE(*t))
                    ++t;
-               if (!*t && (dup2(1,2) != -1)) {
+               if (!*t && (PerlLIO_dup2(1,2) != -1)) {
                    s[-2] = '\0';
                    break;
                }