Ticket #3953: mapped_file.patch

File mapped_file.patch, 849 bytes (added by egoots@…, 13 years ago)

fix to mapped_file.cpp which fixes this error

  • libs/iostreams/src/mapped_file.cpp

     
    197197    if (p.new_file_size != 0 && !readonly) {
    198198        LONG sizehigh = (p.new_file_size >> (sizeof(LONG) * 8));
    199199        LONG sizelow = (p.new_file_size & 0xffffffff);
    200         ::SetFilePointer(handle_, sizelow, &sizehigh, FILE_BEGIN);
    201         if (::GetLastError() != NO_ERROR || !::SetEndOfFile(handle_))
     200        DWORD result = ::SetFilePointer(handle_, sizelow, &sizehigh, FILE_BEGIN);
     201        if ( result == INVALID_SET_FILE_POINTER
     202               && ::GetLastError() != NO_ERROR
     203               || !::SetEndOfFile(handle_))
    202204            cleanup_and_throw("failed setting file size");
    203205    }
    204206