Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/stdio/fdopen.c')
-rw-r--r--newlib/libc/stdio/fdopen.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/newlib/libc/stdio/fdopen.c b/newlib/libc/stdio/fdopen.c
index 50698cbf6..65763b221 100644
--- a/newlib/libc/stdio/fdopen.c
+++ b/newlib/libc/stdio/fdopen.c
@@ -100,6 +100,12 @@ _DEFUN (_fdopen_r, (ptr, fd, mode),
fp->_write = __swrite;
fp->_seek = __sseek;
fp->_close = __sclose;
+
+#ifdef __SCLE
+ if (setmode(fp->_file, O_BINARY) == O_TEXT)
+ fp->_flags |= __SCLE;
+#endif
+
return fp;
}