mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-06-16 07:33:14 +00:00
lseek: let the host OS set lseek errors (#2370)
* Fix lseek(fd, -1, SEEK_SET) for XNA * be sure, if seek really return error * refactoring * let host os set lseek errors
This commit is contained in:
parent
16a68d78eb
commit
1908d26093
2 changed files with 1 additions and 14 deletions
|
@ -377,20 +377,6 @@ bool IOFile::Seek(s64 offset, SeekOrigin origin) const {
|
|||
return false;
|
||||
}
|
||||
|
||||
if (False(file_access_mode & (FileAccessMode::Write | FileAccessMode::Append))) {
|
||||
u64 size = GetSize();
|
||||
if (origin == SeekOrigin::CurrentPosition && Tell() + offset > size) {
|
||||
LOG_ERROR(Common_Filesystem, "Seeking past the end of the file");
|
||||
return false;
|
||||
} else if (origin == SeekOrigin::SetOrigin && (u64)offset > size) {
|
||||
LOG_ERROR(Common_Filesystem, "Seeking past the end of the file");
|
||||
return false;
|
||||
} else if (origin == SeekOrigin::End && offset > 0) {
|
||||
LOG_ERROR(Common_Filesystem, "Seeking past the end of the file");
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
errno = 0;
|
||||
|
||||
const auto seek_result = fseeko(file, offset, ToSeekOrigin(origin)) == 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue