diff options
Diffstat (limited to 'newlib/libc/stdio/fopen.c')
-rw-r--r-- | newlib/libc/stdio/fopen.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/newlib/libc/stdio/fopen.c b/newlib/libc/stdio/fopen.c index 30aa54e04..d54f46af6 100644 --- a/newlib/libc/stdio/fopen.c +++ b/newlib/libc/stdio/fopen.c @@ -116,6 +116,9 @@ static char sccsid[] = "%W% (Berkeley) %G%"; #include <stdio.h> #include <errno.h> #include "local.h" +#ifdef __CYGWIN__ +#include <fcntl.h> +#endif FILE * _DEFUN (_fopen_r, (ptr, file, mode), @@ -149,6 +152,11 @@ _DEFUN (_fopen_r, (ptr, file, mode), if (fp->_flags & __SAPP) fseek (fp, 0, SEEK_END); +#ifdef __SCLE + if (setmode(fp->_file, O_BINARY) == O_TEXT) + fp->_flags |= __SCLE; +#endif + return fp; } |