summaryrefslogtreecommitdiff
path: root/io.c
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-12 07:59:28 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2003-03-12 07:59:28 +0000
commit38ceb49b79cbc623efe3b4844faa2a26078d3b08 (patch)
tree26405968ce13a96ae53e6d48879f7486117611b3 /io.c
parentcaa55aa13f84e811a01089055c8b5841761565f4 (diff)
* io.c (prep_stdio): set binmode only if the file descriptor
is not connected to a terminal on Cygwin. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3579 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'io.c')
-rw-r--r--io.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/io.c b/io.c
index af370ddeb4..12c60482fc 100644
--- a/io.c
+++ b/io.c
@@ -2792,8 +2792,10 @@ prep_stdio(f, mode, klass)
MakeOpenFile(io, fp);
#ifdef __CYGWIN__
- mode |= O_BINARY;
- setmode(fileno(f), O_BINARY);
+ if (!isatty(fileno(f))) {
+ mode |= O_BINARY;
+ setmode(fileno(f), O_BINARY);
+ }
#endif
fp->f = f;
fp->mode = mode;