From 61e904f6600b3bf92ff29f0fff1afc3ed11759fc 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: http://svn.ruby-lang.org/repos/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 af370ddeb..12c60482f 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