Boost logo

Boost-Commit :

From: Frank.Birbacher_at_[hidden]
Date: 2007-10-29 09:41:31


Author: birbacher
Date: 2007-10-29 09:41:30 EDT (Mon, 29 Oct 2007)
New Revision: 40550
URL: http://svn.boost.org/trac/boost/changeset/40550

Log:
merged fixes from previous instance of branch (r38875:40542), addressing #856 and #586
Added:
   sandbox-branches/birbacher/fix_iostreams/libs/iostreams/test/error_test.cpp
      - copied unchanged from r40542, /sandbox-branches/birbacher/fix_iostreams/libs/iostreams/test/error_test.cpp
Text files modified:
   sandbox-branches/birbacher/fix_iostreams/libs/iostreams/src/file_descriptor.cpp | 12 ++++++++----
   sandbox-branches/birbacher/fix_iostreams/libs/iostreams/test/Jamfile.v2 | 1 +
   2 files changed, 9 insertions(+), 4 deletions(-)

Modified: sandbox-branches/birbacher/fix_iostreams/libs/iostreams/src/file_descriptor.cpp
==============================================================================
--- sandbox-branches/birbacher/fix_iostreams/libs/iostreams/src/file_descriptor.cpp (original)
+++ sandbox-branches/birbacher/fix_iostreams/libs/iostreams/src/file_descriptor.cpp 2007-10-29 09:41:30 EDT (Mon, 29 Oct 2007)
@@ -159,8 +159,10 @@
 #ifdef BOOST_IOSTREAMS_WINDOWS
     if (pimpl_->flags_ & impl::has_handle) {
         if (pimpl_->flags_ & impl::append) {
- ::SetFilePointer(pimpl_->handle_, 0, NULL, FILE_END);
- if (::GetLastError() != NO_ERROR)
+ DWORD const dwResult =
+ ::SetFilePointer(pimpl_->handle_, 0, NULL, FILE_END);
+ if (dwResult == INVALID_SET_FILE_POINTER
+ && ::GetLastError() != NO_ERROR)
                 throw detail::bad_seek();
         }
         DWORD ignore;
@@ -192,10 +194,12 @@
                                   way == BOOST_IOS::cur ?
                                     FILE_CURRENT :
                                     FILE_END );
- if (::GetLastError() != NO_ERROR) {
+ if (dwResultLow == INVALID_SET_FILE_POINTER
+ && ::GetLastError() != NO_ERROR) {
             throw detail::bad_seek();
         } else {
- return offset_to_position((lDistanceToMoveHigh << 32) + dwResultLow);
+ return offset_to_position(
+ (stream_offset(lDistanceToMoveHigh) << 32) + dwResultLow);
         }
     }
 #endif // #ifdef BOOST_IOSTREAMS_WINDOWS

Modified: sandbox-branches/birbacher/fix_iostreams/libs/iostreams/test/Jamfile.v2
==============================================================================
--- sandbox-branches/birbacher/fix_iostreams/libs/iostreams/test/Jamfile.v2 (original)
+++ sandbox-branches/birbacher/fix_iostreams/libs/iostreams/test/Jamfile.v2 2007-10-29 09:41:30 EDT (Mon, 29 Oct 2007)
@@ -46,6 +46,7 @@
           [ test-iostreams counter_test.cpp ]
           [ test-iostreams direct_adapter_test.cpp ]
           [ test-iostreams example_test.cpp ]
+ [ test-iostreams error_test.cpp ]
           [ test-iostreams file_test.cpp ]
           [ test-iostreams
                 file_descriptor_test.cpp


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk