summaryrefslogtreecommitdiff
path: root/Source/Core/WinUpdater/Platform.cpp
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2023-03-09 18:18:09 -0800
committerShawn Hoffman <godisgovernment@gmail.com>2023-03-11 12:58:33 -0800
commitde0bc06856bb4d1c36a62c84bc4f8e245138c090 (patch)
tree64d228df0a3454ef1717c809199c45d03537ce61 /Source/Core/WinUpdater/Platform.cpp
parent804b94ee9e73339f94a8f021ac444a1cdda01978 (diff)
updater: flush log after each write
Diffstat (limited to 'Source/Core/WinUpdater/Platform.cpp')
-rw-r--r--Source/Core/WinUpdater/Platform.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Source/Core/WinUpdater/Platform.cpp b/Source/Core/WinUpdater/Platform.cpp
index f60a6621c0..1cfa6b4327 100644
--- a/Source/Core/WinUpdater/Platform.cpp
+++ b/Source/Core/WinUpdater/Platform.cpp
@@ -241,7 +241,7 @@ static VersionCheckResult OSVersionCheck(const BuildInfo& build_info)
std::optional<BuildInfos> InitBuildInfos(const std::vector<TodoList::UpdateOp>& to_update,
const std::string& install_base_path,
- const std::string& temp_dir, FILE* log_fp)
+ const std::string& temp_dir)
{
const auto op_it = std::find_if(to_update.cbegin(), to_update.cend(),
[&](const auto& op) { return op.filename == "build_info.txt"; });
@@ -255,7 +255,7 @@ std::optional<BuildInfos> InitBuildInfos(const std::vector<TodoList::UpdateOp>&
if (!File::ReadFileToString(build_info_path, build_info_content) ||
op.new_hash != ComputeHash(build_info_content))
{
- fprintf(log_fp, "Failed to read %s\n.", build_info_path.c_str());
+ LogToFile("Failed to read %s\n.", build_info_path.c_str());
return {};
}
BuildInfos build_infos;
@@ -266,7 +266,7 @@ std::optional<BuildInfos> InitBuildInfos(const std::vector<TodoList::UpdateOp>&
if (File::ReadFileToString(build_info_path, build_info_content))
{
if (op.old_hash != ComputeHash(build_info_content))
- fprintf(log_fp, "Using modified existing BuildInfo %s.\n", build_info_path.c_str());
+ LogToFile("Using modified existing BuildInfo %s.\n", build_info_path.c_str());
build_infos.current = Platform::BuildInfo(build_info_content);
}
return build_infos;
@@ -305,9 +305,9 @@ bool CheckBuildInfo(const BuildInfos& build_infos)
}
bool VersionCheck(const std::vector<TodoList::UpdateOp>& to_update,
- const std::string& install_base_path, const std::string& temp_dir, FILE* log_fp)
+ const std::string& install_base_path, const std::string& temp_dir)
{
- auto build_infos = InitBuildInfos(to_update, install_base_path, temp_dir, log_fp);
+ auto build_infos = InitBuildInfos(to_update, install_base_path, temp_dir);
// If there's no build info, it means the check should be skipped.
if (!build_infos.has_value())
{