Skip to content

Commit

Permalink
xrCore: fix file_stream_reader
Browse files Browse the repository at this point in the history
  • Loading branch information
eagleivg committed Jun 12, 2018
1 parent 2808612 commit 1ea157e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/xrCore/file_stream_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,15 @@ void CFileStreamReader::construct(LPCSTR file_name, const u32& window_size)
HANDLE file_mapping_handle = CreateFileMapping(m_file_handle, 0, PAGE_READONLY, 0, 0, 0);
VERIFY(file_mapping_handle != INVALID_HANDLE_VALUE);

inherited::construct(file_mapping_handle, 0, file_size, file_size, window_size);
#elif defined(LINUX)
m_file_handle = ::open(file_name, O_RDONLY);
VERIFY(m_file_handle != -1);
struct stat file_info;
::fstat(m_file_handle, &file_info);
u32 file_size = (u32)file_info.st_size;
#endif
inherited::construct(&m_file_handle, 0, file_size, file_size, window_size);
#endif
}

void CFileStreamReader::destroy()
Expand Down

0 comments on commit 1ea157e

Please sign in to comment.