summaryrefslogtreecommitdiff
path: root/doio.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2000-11-24 22:24:33 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2000-11-24 22:24:33 +0000
commitf5b9d040829bb5deb93173e35ee6c82ce0a01c37 (patch)
tree0db2c5de2e4564417efd7178e7a45378073511bc /doio.c
parentde6cd452fde5aaf57e339f71b33b6a0852f0f96d (diff)
downloadperl-f5b9d040829bb5deb93173e35ee6c82ce0a01c37.tar.gz
Re-arrange crlf vs binary for platforms that care.
crlf layer is now "the" buffer layer and can turn its behaviour on/off. Lip-service to making stdio layer work on such platforms (untested). Now fails 3 tests rather than one, checkin to see if I can debug the issue under linux. (Do not merge.) p4raw-id: //depot/perlio@7853
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++;