summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
Diffstat (limited to 'doio.c')
-rw-r--r--doio.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/doio.c b/doio.c
index 0da9856c30..3e36ea36e9 100644
--- a/doio.c
+++ b/doio.c
@@ -474,13 +474,17 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
#endif
}
if (saveifp) { /* must use old fp? */
+ /* If fd is less that PL_maxsysfd i.e. STDIN..STDERR
+ then dup the new fileno down
+ */
fd = PerlIO_fileno(saveifp);
if (saveofp) {
- PerlIO_flush(saveofp); /* emulate PerlIO_close() */
+ PerlIO_flush(saveofp); /* emulate PerlIO_close() */
if (saveofp != saveifp) { /* was a socket? */
PerlIO_close(saveofp);
+ /* This looks very suspect - NI-S 24 Nov 2000 */
if (fd > 2)
- Safefree(saveofp);
+ Safefree(saveofp); /* ??? */
}
}
if (fd != PerlIO_fileno(fp)) {
@@ -528,9 +532,6 @@ Perl_do_open9(pTHX_ GV *gv, register char *name, I32 len, int as_raw,
}
}
}
- else if (O_BINARY != O_TEXT && IoTYPE(io) != IoTYPE_STD && !saveifp) {
- type = ":crlf";
- }
}
if (type) {
while (isSPACE(*type)) type++;