Move fflush call to WriteRaw

To prevent future cases of this issue.
This commit is contained in:
Stephen Miller 2025-06-15 13:25:37 -05:00
parent db19ea1622
commit ec70160936
2 changed files with 4 additions and 5 deletions

View File

@ -186,7 +186,9 @@ public:
template <typename T>
size_t WriteRaw(const void* data, size_t size) const {
return std::fwrite(data, sizeof(T), size, file);
auto bytes = std::fwrite(data, sizeof(T), size, file);
std::fflush(file);
return bytes;
}
template <typename T>

View File

@ -294,10 +294,7 @@ s64 PS4_SYSV_ABI write(s32 fd, const void* buf, size_t nbytes) {
return result;
}
auto bytes_written = file->f.WriteRaw<u8>(buf, nbytes);
// Some written data might be buffered, run Flush to make sure all data is written properly.
file->f.Flush();
return bytes_written;
return file->f.WriteRaw<u8>(buf, nbytes);
}
s64 PS4_SYSV_ABI posix_write(s32 fd, const void* buf, size_t nbytes) {