This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: yet another freopen(NULL) patch


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
 



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]