Page MenuHomePhabricator

D3979.diff
No OneTemporary

D3979.diff

diff --git a/src/fs.h b/src/fs.h
--- a/src/fs.h
+++ b/src/fs.h
@@ -17,7 +17,6 @@
/** Bridge operations to C stdio */
namespace fsbridge {
FILE *fopen(const fs::path &p, const char *mode);
-FILE *freopen(const fs::path &p, const char *mode, FILE *stream);
}; // namespace fsbridge
#endif // BITCOIN_FS_H
diff --git a/src/fs.cpp b/src/fs.cpp
--- a/src/fs.cpp
+++ b/src/fs.cpp
@@ -11,8 +11,5 @@
return ::fopen(p.string().c_str(), mode);
}
-FILE *freopen(const fs::path &p, const char *mode, FILE *stream) {
- return ::freopen(p.string().c_str(), mode, stream);
-}
} // namespace fsbridge
diff --git a/src/logging.cpp b/src/logging.cpp
--- a/src/logging.cpp
+++ b/src/logging.cpp
@@ -182,14 +182,14 @@
if (m_reopen_file) {
m_reopen_file = false;
fs::path pathDebug = GetDebugLogPath();
- m_fileout = fsbridge::freopen(pathDebug, "a", m_fileout);
- if (!m_fileout) {
- return;
+ FILE *new_fileout = fsbridge::fopen(pathDebug, "a");
+ if (new_fileout) {
+ // unbuffered.
+ setbuf(m_fileout, nullptr);
+ fclose(m_fileout);
+ m_fileout = new_fileout;
}
- // unbuffered.
- setbuf(m_fileout, nullptr);
}
-
FileWriteStr(strTimestamped, m_fileout);
}
}

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 1, 10:57 (15 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5187431
Default Alt Text
D3979.diff (1 KB)

Event Timeline