From 7fcc8648fca0f4d7a8fb03f8844a4b53cd63bc94 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 12 Jul 2016 06:44:32 -0700 Subject: Default stdio streams to text mode. * newlib/libc/stdio/flags.c (__sflags): If mode is not O_BINARY, then add O_TEXT. --- newlib/libc/stdio/flags.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/newlib/libc/stdio/flags.c b/newlib/libc/stdio/flags.c index 7bbd50181..f6331bce4 100644 --- a/newlib/libc/stdio/flags.c +++ b/newlib/libc/stdio/flags.c @@ -89,6 +89,10 @@ __sflags (struct _reent *ptr, break; } } +#if defined (O_TEXT) + if (!(m & O_BINARY)) + m |= O_TEXT; +#endif *optr = m | o; return ret; } -- cgit v1.2.3