diff options
author | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-12 07:59:28 +0000 |
---|---|---|
committer | eban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-03-12 07:59:28 +0000 |
commit | 38ceb49b79cbc623efe3b4844faa2a26078d3b08 (patch) | |
tree | 26405968ce13a96ae53e6d48879f7486117611b3 /io.c | |
parent | caa55aa13f84e811a01089055c8b5841761565f4 (diff) | |
download | ruby-38ceb49b79cbc623efe3b4844faa2a26078d3b08.tar.gz |
* 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.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -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; |