mirror of
https://github.com/shadps4-emu/shadPS4.git
synced 2025-07-24 19:14:40 +00:00
Move fflush call to WriteRaw
To prevent future cases of this issue.
This commit is contained in:
parent
db19ea1622
commit
ec70160936
@ -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>
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user