diff options
author | Paul Green <Paul.Green@stratus.com> | 2013-03-18 23:43:25 -0400 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2013-03-19 15:45:46 -0600 |
commit | 93f31ee9fb6e815cac5df15822755aa4d75c91a9 (patch) | |
tree | 23d6311f0aafdb9a103d94d221db85b6efeb5378 /perlio.c | |
parent | c0fcb8c5be7ac45a02537b1427a228c526293b5b (diff) | |
download | perl-93f31ee9fb6e815cac5df15822755aa4d75c91a9.tar.gz |
Ensure only DOSish builds force O_BINARY=1 in the open path
Diffstat (limited to 'perlio.c')
-rw-r--r-- | perlio.c | 13 |
1 files changed, 9 insertions, 4 deletions
@@ -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; |