mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Handle unsuccessful fseek(...):s
This commit is contained in:
parent
57c57df86f
commit
29c9bdcc14
3 changed files with 10 additions and 3 deletions
|
|
@ -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);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue