Convert return value to what is expected by FileStream::seek

This commit is contained in:
rh101 2021-04-26 01:37:15 +10:00
parent 434d2730d6
commit d76cb66e8e
1 changed files with 2 additions and 1 deletions

View File

@ -151,7 +151,8 @@ int PosixFileStream::close()
int PosixFileStream::seek(long offset, int origin) int PosixFileStream::seek(long offset, int origin)
{ {
return static_cast<int>(_iof->seek(_handle, offset, origin)); const auto result = _iof->seek(_handle, offset, origin); // this returns -1 for error, and resulting offset on success
return result < 0 ? -1 : 0; // return 0 for success
} }
int PosixFileStream::read(void* buf, unsigned int size) int PosixFileStream::read(void* buf, unsigned int size)