diff options
| author | practicalswift <[email protected]> | 2018-05-02 12:12:55 +0200 |
|---|---|---|
| committer | practicalswift <[email protected]> | 2018-05-02 12:12:55 +0200 |
| commit | 29c9bdcc141afb14fc9e1213f49de4fcded6ce0c (patch) | |
| tree | cc332a0390a37bbbc01fbaf098bde75eab166de6 /src/logging.cpp | |
| parent | Merge #13141: [doc] qt: fixes broken link on readme (diff) | |
| download | discoin-29c9bdcc141afb14fc9e1213f49de4fcded6ce0c.tar.xz discoin-29c9bdcc141afb14fc9e1213f49de4fcded6ce0c.zip | |
Handle unsuccessful fseek(...):s
Diffstat (limited to 'src/logging.cpp')
| -rw-r--r-- | src/logging.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/logging.cpp b/src/logging.cpp index 10a3b1895..2a55d3665 100644 --- a/src/logging.cpp +++ b/src/logging.cpp @@ -254,7 +254,10 @@ void BCLog::Logger::ShrinkDebugFile() { // Restart the file with some of the end std::vector<char> vch(RECENT_DEBUG_HISTORY_SIZE, 0); - fseek(file, -((long)vch.size()), SEEK_END); + if (fseek(file, -((long)vch.size()), SEEK_END)) { + fclose(file); + return; + } int nBytes = fread(vch.data(), 1, vch.size(), file); fclose(file); |