This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: yet another freopen(NULL) patch
- From: Eric Blake <ebb9 at byu dot net>
- To: newlib at sources dot redhat dot com
- Date: Wed, 22 Mar 2006 16:19:14 +0000 (UTC)
- Subject: Re: yet another freopen(NULL) patch
- References: <440C3BD9.4050600@byu.net>
And patch number 4 on this same issue - I still had a typo that only
affects platforms with setmode (ie. cygwin). Maybe I've caught all the
corner cases now? Thanks for bearing with my repeated patch efforts...
2006-03-22 Eric Blake <ebb9@byu.net>
* libc/stdio/freopen.c (_freopen_r) [__SCLE]: Fix typo.
* libc/stdio64/freopen64.c (_freopen64_r) [__SCLE]: Likewise.
Index: libc/stdio/freopen.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio/freopen.c,v
retrieving revision 1.16
diff -u -b -r1.16 freopen.c
--- libc/stdio/freopen.c 7 Mar 2006 22:20:18 -0000 1.16
+++ libc/stdio/freopen.c 22 Mar 2006 15:16:10 -0000
@@ -168,7 +168,7 @@
* F_SETFL doesn't change textmode. Don't mess with modes of ttys.
*/
if (0 <= f && ! isatty (f)
- && setmode (f, flags & (O_BINARY | O_TEXT)) == -1)
+ && setmode (f, oflags & (O_BINARY | O_TEXT)) == -1)
f = -1;
#endif
Index: libc/stdio64/freopen64.c
===================================================================
RCS file: /cvs/src/src/newlib/libc/stdio64/freopen64.c,v
retrieving revision 1.11
diff -u -b -r1.11 freopen64.c
--- libc/stdio64/freopen64.c 7 Mar 2006 22:20:18 -0000 1.11
+++ libc/stdio64/freopen64.c 22 Mar 2006 15:16:10 -0000
@@ -168,7 +168,7 @@
* F_SETFL doesn't change textmode. Don't mess with modes of ttys.
*/
if (0 <= f && ! isatty (f)
- && setmode (f, flags & (O_BINARY | O_TEXT)) == -1)
+ && setmode (f, oflags & (O_BINARY | O_TEXT)) == -1)
f = -1;
#endif