From ae24bd0701863977f099cbbc2324b869dc6862ed Mon Sep 17 00:00:00 2001 From: wheremyfoodat <44909372+wheremyfoodat@users.noreply.github.com> Date: Sun, 17 Dec 2023 20:35:07 +0200 Subject: [PATCH] Optionally flush file in File::Write --- src/core/kernel/file_operations.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/core/kernel/file_operations.cpp b/src/core/kernel/file_operations.cpp index c7837100..972190fa 100644 --- a/src/core/kernel/file_operations.cpp +++ b/src/core/kernel/file_operations.cpp @@ -148,6 +148,11 @@ void Kernel::writeFile(u32 messagePointer, Handle fileHandle) { IOFile f(file->fd); auto [success, bytesWritten] = f.writeBytes(data.get(), size); + // TODO: Should this check only the byte? + if (writeOption) { + f.flush(); + } + mem.write32(messagePointer, IPC::responseHeader(0x0803, 2, 2)); if (!success) { Helpers::panic("Kernel::WriteFile failed");