mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 22:18:54 +01:00
Handle unsuccessful fseek(...):s
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user