summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorIlya Zakharevich <ilya@math.berkeley.edu>2002-04-01 19:37:08 -0500
committerJarkko Hietaniemi <jhi@iki.fi>2002-04-02 15:05:58 +0000
commit23b847786cf7d86c6da9c7a772a1aef6918eee65 (patch)
tree958280d566e8bbe4db873d1780b4db2f87fa5b9c /perlio.c
parentbf15e14c329c58d53cd425c0a506d27028d00e38 (diff)
downloadperl-23b847786cf7d86c6da9c7a772a1aef6918eee65.tar.gz
ASCII vs BINARY on OS/2 in perlio
Message-ID: <20020402003708.A8648@math.ohio-state.edu> p4raw-id: //depot/perl@15682
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/perlio.c b/perlio.c
index 12536961fb..0f34462c36 100644
--- a/perlio.c
+++ b/perlio.c
@@ -2891,18 +2891,23 @@ PerlIOBuf_open(pTHX_ PerlIO_funcs *self, PerlIO_list_t *layers,
return NULL;
} else {
fd = PerlIO_fileno(f);
-#ifdef PERLIO_USING_CRLF
- /*
- * do something about failing setmode()? --jhi
- */
- PerlLIO_setmode(fd, O_BINARY);
-#endif
if (init && fd == 2) {
/*
* Initial stderr is unbuffered
*/
PerlIOBase(f)->flags |= PERLIO_F_UNBUF;
}
+#ifdef PERLIO_USING_CRLF
+# ifdef PERLIO_IS_BINMODE_FD
+ if (PERLIO_IS_BINMODE_FD(fd))
+ PerlIO_binmode(f, '<'/*not used*/, O_BINARY, Nullch);
+ else
+# endif
+ /*
+ * do something about failing setmode()? --jhi
+ */
+ PerlLIO_setmode(fd, O_BINARY);
+#endif
}
}
}