diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2000-05-03 03:57:19 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2000-05-03 03:57:19 +0000 |
commit | 49d64538cd20abeabd5678b28db05da6fda5e17a (patch) | |
tree | 4414b704fdc406f7dd2a51bd436591ae10888b99 /newlib/libc/stdio/freopen.c | |
parent | a939e045e7c300f401dd96596122d34511be289a (diff) | |
download | cygnal-49d64538cd20abeabd5678b28db05da6fda5e17a.tar.gz cygnal-49d64538cd20abeabd5678b28db05da6fda5e17a.tar.bz2 cygnal-49d64538cd20abeabd5678b28db05da6fda5e17a.zip |
Tue May 02 23:45:48 2000 DJ Delorie <dj@cygnus.com>
* libc/include/stdio.h (FILE): define __SCLE for "convert line
endings" for Cygwin.
(__sgetc): convert line endings if needed
(__sputc): ditto
* libc/stdio/fdopen.c (_fdopen_r): Remember if we opened in text mode
* libc/stdio/fopen.c (_fopen_r): ditto
* libc/stdio/freopen.c (freopen): ditto
* libc/stdio/fread.c (fread): perform CRLF conversions if __SCLE
* libc/stdio/fvwrite.c (__sfvwrite): ditto
Diffstat (limited to 'newlib/libc/stdio/freopen.c')
-rw-r--r-- | newlib/libc/stdio/freopen.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/newlib/libc/stdio/freopen.c b/newlib/libc/stdio/freopen.c index a4ab965e9..a23b08ad5 100644 --- a/newlib/libc/stdio/freopen.c +++ b/newlib/libc/stdio/freopen.c @@ -147,5 +147,11 @@ _DEFUN (freopen, (file, mode, fp), 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; } |