summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-09-17 20:15:04 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-09-17 20:15:04 -0700
commit77071d894d0e5425198d62ea5b16c8a43e7bd75a (patch)
tree70607434d927e42fe6b36f6e71624bd99539adeb
parent0422f5458e76aedf04d539c338da534ff8889ad1 (diff)
downloadcygnal-77071d894d0e5425198d62ea5b16c8a43e7bd75a.tar.gz
cygnal-77071d894d0e5425198d62ea5b16c8a43e7bd75a.tar.bz2
cygnal-77071d894d0e5425198d62ea5b16c8a43e7bd75a.zip
Arrange for text mode on stdin, stdout and stderr.
* newlib/libc/stdio/findfp.c (__sinit): Add the Cygwin-specific __SCLE (stream convert line endings) flag when calling the std function to initializing the reent structure's _stdin, _stdout and _stderr members.
-rw-r--r--newlib/libc/stdio/findfp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c
index 975a855c2..3a9ff6992 100644
--- a/newlib/libc/stdio/findfp.c
+++ b/newlib/libc/stdio/findfp.c
@@ -236,7 +236,9 @@ _DEFUN(__sinit, (s),
s->_stderr = __sfp(s);
#endif
- std (s->_stdin, __SRD, 0, s);
+ /* Cygnal: __SCLE is added to all descriptors to make
+ enable line-ending conversion. */
+ std (s->_stdin, __SRD | __SCLE, 0, s);
/* On platforms that have true file system I/O, we can verify
whether stdout is an interactive terminal or not, as part of
@@ -245,14 +247,14 @@ _DEFUN(__sinit, (s),
requires both stdin and stdout to be line-buffered, but tradition
leaves stdin alone on systems without fcntl. */
#ifdef HAVE_FCNTL
- std (s->_stdout, __SWR, 1, s);
+ std (s->_stdout, __SWR | __SCLE, 1, s);
#else
- std (s->_stdout, __SWR | __SLBF, 1, s);
+ std (s->_stdout, __SWR | __SLBF | __SCLE, 1, s);
#endif
/* POSIX requires stderr to be opened for reading and writing, even
when the underlying fd 2 is write-only. */
- std (s->_stderr, __SRW | __SNBF, 2, s);
+ std (s->_stderr, __SRW | __SNBF | __SCLE, 2, s);
s->__sdidinit = 1;