summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-07-12 06:44:32 -0700
committerKaz Kylheku <kaz@kylheku.com>2017-11-16 19:34:59 -0800
commit7b8e6c2635358a11818d22b18741db29aca72742 (patch)
treefdd8e3e692408e1f9e288fe4d50fc2aad8e61389
parentafd8d80e47348105616c8c411029c4ec0361d0ba (diff)
downloadcygnal-7b8e6c2635358a11818d22b18741db29aca72742.tar.gz
cygnal-7b8e6c2635358a11818d22b18741db29aca72742.tar.bz2
cygnal-7b8e6c2635358a11818d22b18741db29aca72742.zip
Default stdio streams to text mode.
* newlib/libc/stdio/flags.c (__sflags): Enable for Cygwin the piece of code which adds the O_TEXT mode if O_BINARY is not present. And, also, fix that piece of code's incorrect use of the | operator to test a flag instead of &.
-rw-r--r--newlib/libc/stdio/flags.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/newlib/libc/stdio/flags.c b/newlib/libc/stdio/flags.c
index 518cc33f1..7d18fd1d1 100644
--- a/newlib/libc/stdio/flags.c
+++ b/newlib/libc/stdio/flags.c
@@ -90,8 +90,8 @@ _DEFUN(__sflags, (ptr, mode, optr),
break;
}
}
-#if defined (O_TEXT) && !defined (__CYGWIN__)
- if (!(m | O_BINARY))
+#if defined (O_TEXT)
+ if (!(m & O_BINARY))
m |= O_TEXT;
#endif
*optr = m | o;