diff options
Diffstat (limited to 'newlib/libc')
-rw-r--r-- | newlib/libc/stdio/findfp.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/newlib/libc/stdio/findfp.c b/newlib/libc/stdio/findfp.c index 64abb1c6b..c6790c491 100644 --- a/newlib/libc/stdio/findfp.c +++ b/newlib/libc/stdio/findfp.c @@ -152,7 +152,16 @@ __sinit (s) s->__sdidinit = 1; std (s->__sf + 0, __SRD, 0, s); + + /* on platforms that have true file system I/O, we can verify whether stdout + is an interactive terminal or not. For all other platforms, we will + default to line buffered mode here. */ +#ifdef HAVE_FCNTL + std (s->__sf + 1, __SWR, 1, s); +#else std (s->__sf + 1, __SWR | __SLBF, 1, s); +#endif + std (s->__sf + 2, __SWR | __SNBF, 2, s); s->__sglue._next = NULL; |