This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
libstdc++ typo fix
- From: Alan Modra <amodra at bigpond dot net dot au>
- To: gcc-patches at gcc dot gnu dot org
- Date: Wed, 10 Sep 2003 00:05:42 +0930
- Subject: libstdc++ typo fix
Noticed when looking for a ppc64 bug.
* config/io/basic_file_stdio.cc (_M_open_mode): Assign __p_mode
rather than or'ing.
Index: libstdc++-v3/config/io/basic_file_stdio.cc
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/config/io/basic_file_stdio.cc,v
retrieving revision 1.17
diff -u -p -r1.17 basic_file_stdio.cc
--- libstdc++-v3/config/io/basic_file_stdio.cc 14 Jul 2003 18:23:12 -0000 1.17
+++ libstdc++-v3/config/io/basic_file_stdio.cc 9 Sep 2003 13:59:34 -0000
@@ -87,33 +87,33 @@ namespace std
if (!__testi && __testo && !__testt && !__testa)
{
strcpy(__c_mode, "w");
- __p_mode = (O_WRONLY | O_CREAT);
+ __p_mode = O_WRONLY | O_CREAT;
}
if (!__testi && __testo && !__testt && __testa)
{
strcpy(__c_mode, "a");
- __p_mode |= O_WRONLY | O_CREAT | O_APPEND;
+ __p_mode = O_WRONLY | O_CREAT | O_APPEND;
}
if (!__testi && __testo && __testt && !__testa)
{
strcpy(__c_mode, "w");
- __p_mode |= O_WRONLY | O_CREAT | O_TRUNC;
+ __p_mode = O_WRONLY | O_CREAT | O_TRUNC;
}
if (__testi && !__testo && !__testt && !__testa)
{
strcpy(__c_mode, "r");
- __p_mode |= O_RDONLY;
+ __p_mode = O_RDONLY;
}
if (__testi && __testo && !__testt && !__testa)
{
strcpy(__c_mode, "r+");
- __p_mode |= O_RDWR | O_CREAT;
+ __p_mode = O_RDWR | O_CREAT;
}
if (__testi && __testo && __testt && !__testa)
{
strcpy(__c_mode, "w+");
- __p_mode |= O_RDWR | O_CREAT | O_TRUNC;
+ __p_mode = O_RDWR | O_CREAT | O_TRUNC;
}
if (__testb)
strcat(__c_mode, "b");
--
Alan Modra
IBM OzLabs - Linux Technology Centre