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 2ddce35 commit cceedbcCopy full SHA for cceedbc
src/logging.cpp
@@ -219,13 +219,13 @@ void BCLog::Logger::LogPrintStr(const std::string &str)
219
// reopen the log file, if requested
220
if (m_reopen_file) {
221
m_reopen_file = false;
222
- m_fileout = fsbridge::freopen(m_file_path, "a", m_fileout);
223
- if (!m_fileout) {
224
- return;
+ FILE* new_fileout = fsbridge::fopen(m_file_path, "a");
+ if (new_fileout) {
+ setbuf(new_fileout, nullptr); // unbuffered
225
+ fclose(m_fileout);
226
+ m_fileout = new_fileout;
227
}
- setbuf(m_fileout, nullptr); // unbuffered
228
-
229
FileWriteStr(strTimestamped, m_fileout);
230
231
0 commit comments