From 38ceb49b79cbc623efe3b4844faa2a26078d3b08 Mon Sep 17 00:00:00 2001 From: eban Date: Wed, 12 Mar 2003 07:59:28 +0000 Subject: * 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 --- io.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'io.c') 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; -- cgit v1.2.3