diff options
-rw-r--r-- | newlib/ChangeLog | 6 | ||||
-rw-r--r-- | newlib/libc/stdio/freopen.c | 2 | ||||
-rw-r--r-- | newlib/libc/stdio64/freopen64.c | 3 |
3 files changed, 10 insertions, 1 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 1aff1c606..c49f109c8 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,9 @@ +2015-12-08 Corinna Vinschen <corinna@vinschen.de> + + * libc/stdio/freopen.c (_freopen_r): Only reset __SWID bit per SUSv4. + * libc/stdio64/freopen64.c (_freopen64_r): Add missing resetting of + flag values and _mbstate. + 2015-12-07 Nick Withers <nick.withers@anu.edu.au> * libc/sys/arm/sys/param.h (NBBY): Define if not already defined. diff --git a/newlib/libc/stdio/freopen.c b/newlib/libc/stdio/freopen.c index a696a9dd8..235ffba53 100644 --- a/newlib/libc/stdio/freopen.c +++ b/newlib/libc/stdio/freopen.c @@ -209,7 +209,7 @@ _DEFUN(_freopen_r, (ptr, file, mode, fp), FREELB (ptr, fp); fp->_lb._size = 0; fp->_flags &= ~__SORD; - fp->_flags2 = 0; + fp->_flags2 &= ~__SWID; memset (&fp->_mbstate, 0, sizeof (_mbstate_t)); if (f < 0) diff --git a/newlib/libc/stdio64/freopen64.c b/newlib/libc/stdio64/freopen64.c index dfe36ea3d..a183fb8ea 100644 --- a/newlib/libc/stdio64/freopen64.c +++ b/newlib/libc/stdio64/freopen64.c @@ -208,6 +208,9 @@ _DEFUN (_freopen64_r, (ptr, file, mode, fp), if (HASLB (fp)) FREELB (ptr, fp); fp->_lb._size = 0; + fp->_flags &= ~__SORD; + fp->_flags2 &= ~__SWID; + memset (&fp->_mbstate, 0, sizeof (_mbstate_t)); if (f < 0) { /* did not get it after all */ |