From 4c681666468f25fa263be05ae73ebd27205ebaa4 Mon Sep 17 00:00:00 2001 From: pepper <3782201+rohvani@users.noreply.github.com> Date: Thu, 24 Sep 2026 10:20:04 -0400 Subject: Use portable file ownership for transcript reads Replace the Windows-only LLUniqueFile with std::unique_ptr and the existing LLFile::close deleter. This fixes the macOS compile failure while retaining automatic file closure on every exit. Windows Release build, 41 history tests, and repository hooks passed. macOS CI still needs to be rerun. --- indra/newview/lllogchat.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 9e23cd34be..a163a6a23e 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -48,6 +48,7 @@ #include #include #include +#include #include #if !LL_WINDOWS @@ -488,7 +489,8 @@ void LLLogChat::loadChatHistoryExact(const std::string& path, std::list& m } // Binary mode keeps transcript contents independent of platform EOF handling. - LLUniqueFile input(LLFile::fopen(path, LLFILE_MODE("rb"))); + std::unique_ptr input( + LLFile::fopen(path, LLFILE_MODE("rb")), LLFile::close); if (!input) { LL_WARNS("ChatHistory") << "Unable to read file " << path << LL_ENDL; @@ -499,16 +501,16 @@ void LLLogChat::loadChatHistoryExact(const std::string& path, std::list& m // stitched reads parse from the beginning of each exact transcript path. char buffer[LOG_RECALL_SIZE]; bool skip_partial_line = true; - if (load_params["load_all_history"].asBoolean() || fseek(input, (LOG_RECALL_SIZE - 1) * -1, SEEK_END)) + if (load_params["load_all_history"].asBoolean() || fseek(input.get(), (LOG_RECALL_SIZE - 1) * -1, SEEK_END)) { skip_partial_line = false; - if (fseek(input, 0, SEEK_SET)) + if (fseek(input.get(), 0, SEEK_SET)) { return; } } - while (fgets(buffer, LOG_RECALL_SIZE, input)) + while (fgets(buffer, LOG_RECALL_SIZE, input.get())) { // Normalize either newline style before applying legacy multiline rules. size_t length = strlen(buffer); -- cgit v1.3