mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-22 10:02:01 +00:00
io: Always discard file_ pointer on close()
This commit is contained in:
parent
6f2a73e911
commit
a5b870a0b3
1 changed files with 3 additions and 5 deletions
|
|
@ -157,14 +157,12 @@ void FileStream::close()
|
|||
|
||||
if (std::fclose((std::FILE*)(this->file_)) != 0)
|
||||
{
|
||||
// The FILE is now invalid even though fclose failed.
|
||||
// There is nothing we can do but abandon the pointer.
|
||||
file_ = nullptr;
|
||||
int err = errno;
|
||||
throw make_exception_from_errno(err);
|
||||
}
|
||||
|
||||
if (std::ferror((std::FILE*)(this->file_)) != 0)
|
||||
{
|
||||
int err = errno;
|
||||
throw make_exception_from_errno(err);
|
||||
}
|
||||
file_ = nullptr;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue