// File based streams -*- C++ -*-
-// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+// Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
// Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// You should have received a copy of the GNU General Public License along
// with this library; see the file COPYING. If not, write to the Free
-// Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+// Software Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
// USA.
// As a special exception, you may use this file as part of a free software
#pragma GCC system_header
-namespace std
-{
+_GLIBCXX_BEGIN_NAMESPACE(std)
+
template<typename _CharT, typename _Traits>
void
basic_filebuf<_CharT, _Traits>::
{
// Returns pos_type(off_type(-1)) in case of failure.
__ret = pos_type(_M_file.seekoff(__off, __way));
- _M_reading = false;
- _M_writing = false;
- _M_ext_next = _M_ext_end = _M_ext_buf;
- _M_set_buffer(-1);
- _M_state_cur = __state;
- __ret.state(_M_state_cur);
+ if (__ret != pos_type(off_type(-1)))
+ {
+ _M_reading = false;
+ _M_writing = false;
+ _M_ext_next = _M_ext_end = _M_ext_buf;
+ _M_set_buffer(-1);
+ _M_state_cur = __state;
+ __ret.state(_M_state_cur);
+ }
}
return __ret;
}
extern template class basic_fstream<wchar_t>;
#endif
#endif
-} // namespace std
+
+_GLIBCXX_END_NAMESPACE
#endif