Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13115363
D3979.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D3979.diff
View Options
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
Details
Attached
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)
Attached To
D3979: Merge #13159: Don't close old debug log file handle prematurely when trying to re-open (on SIGHUP)
Event Timeline
Log In to Comment