summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorShawn Hoffman <godisgovernment@gmail.com>2023-03-22 11:06:30 -0700
committerShawn Hoffman <godisgovernment@gmail.com>2023-03-22 11:08:58 -0700
commitfdc16263089ef2fb93a102c39cc9926ca1f91667 (patch)
tree6adc7d82ba84616e33ed9e67fe53bcf3c5bd2ff8 /Source/Core
parent66e414133e4a64473ae06deafadc8b7242239e57 (diff)
test-updater.py: include space and unicode in paths to test
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/UpdaterCommon/UpdaterCommon.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/Source/Core/UpdaterCommon/UpdaterCommon.cpp b/Source/Core/UpdaterCommon/UpdaterCommon.cpp
index 426943ce83..408c313c95 100644
--- a/Source/Core/UpdaterCommon/UpdaterCommon.cpp
+++ b/Source/Core/UpdaterCommon/UpdaterCommon.cpp
@@ -17,6 +17,7 @@
#include "Common/CommonPaths.h"
#include "Common/FileUtil.h"
#include "Common/HttpRequest.h"
+#include "Common/IOFile.h"
#include "Common/ScopeGuard.h"
#include "Common/StringUtil.h"
#include "UpdaterCommon/Platform.h"
@@ -44,15 +45,15 @@ const std::array<u8, 32> UPDATE_PUB_KEY_TEST = {
0x9e, 0xe0, 0x9b, 0x28, 0xc9, 0x1a, 0x60, 0xb7, 0x67, 0x1c, 0xf3, 0xf6, 0xca, 0x1b, 0xdd, 0x1a};
// Where to log updater output.
-static FILE* log_fp = stderr;
+static File::IOFile log_file;
void LogToFile(const char* fmt, ...)
{
va_list args;
va_start(args, fmt);
- vfprintf(log_fp, fmt, args);
- fflush(log_fp);
+ log_file.WriteString(StringFromFormatV(fmt, args));
+ log_file.Flush();
va_end(args);
}
@@ -174,8 +175,8 @@ bool VerifySignature(const std::string& data, const std::string& b64_signature)
void FlushLog()
{
- fflush(log_fp);
- fclose(log_fp);
+ log_file.Flush();
+ log_file.Close();
}
void TodoList::Log() const
@@ -698,9 +699,8 @@ bool RunUpdater(std::vector<std::string> args)
if (opts.log_file)
{
- log_fp = fopen(opts.log_file.value().c_str(), "w");
- if (!log_fp)
- log_fp = stderr;
+ if (!log_file.Open(opts.log_file.value(), "w"))
+ log_file.SetHandle(stderr);
else
atexit(FlushLog);
}