summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorPaul Green <Paul.Green@stratus.com>2013-03-18 23:43:25 -0400
committerKarl Williamson <public@khwilliamson.com>2013-03-19 15:45:46 -0600
commit93f31ee9fb6e815cac5df15822755aa4d75c91a9 (patch)
tree23d6311f0aafdb9a103d94d221db85b6efeb5378 /perlio.c
parentc0fcb8c5be7ac45a02537b1427a228c526293b5b (diff)
downloadperl-93f31ee9fb6e815cac5df15822755aa4d75c91a9.tar.gz
Ensure only DOSish builds force O_BINARY=1 in the open path
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/perlio.c b/perlio.c
index 097bc49664..d356a7b150 100644
--- a/perlio.c
+++ b/perlio.c
@@ -2610,10 +2610,15 @@ PerlIOUnix_oflags(const char *mode)
oflags &= ~O_BINARY;
mode++;
}
- /*
- * Always open in binary mode
- */
- oflags |= O_BINARY;
+ else {
+#ifdef PERLIO_USING_CRLF
+ /*
+ * If neither "t" nor "b" was specified, open the file
+ * in O_BINARY mode.
+ */
+ oflags |= O_BINARY;
+#endif
+ }
if (*mode || oflags == -1) {
SETERRNO(EINVAL, LIB_INVARG);
oflags = -1;