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 | 61e904f6600b3bf92ff29f0fff1afc3ed11759fc (patch) | |
tree | 26405968ce13a96ae53e6d48879f7486117611b3 /io.c | |
parent | 7ad9f0a5615c1e4c7d72b93e4f713b9c6016702d (diff) | |
download | ruby-61e904f6600b3bf92ff29f0fff1afc3ed11759fc.tar.gz ruby-61e904f6600b3bf92ff29f0fff1afc3ed11759fc.tar.xz ruby-61e904f6600b3bf92ff29f0fff1afc3ed11759fc.zip |
* io.c (prep_stdio): set binmode only if the file descriptor
is not connected to a terminal on Cygwin.
git-svn-id: http://svn.ruby-lang.org/repos/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; |