We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b44638c commit 00cf411Copy full SHA for 00cf411
src/util.cpp
@@ -294,9 +294,15 @@ void LogPrintStr(const std::string &str)
294
// reopen the log file, if requested
295
if (fReopenDebugLog) {
296
fReopenDebugLog = false;
297
+
298
fs::path pathDebug = GetDataDir() / "debug.log";
- if (freopen(pathDebug.string().c_str(),"a",fileout) != NULL)
299
- setbuf(fileout, NULL); // unbuffered
+ FILE* new_fileout = fsbridge::fopen(pathDebug, "a");
300
301
+ if (new_fileout) {
302
+ setbuf(new_fileout, NULL); // unbuffered
303
+ fclose(fileout);
304
+ fileout = new_fileout;
305
+ }
306
}
307
308
// Debug print useful for profiling
0 commit comments