mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 01:58:20 +00:00
Add more error handling for close() calls.
This commit is contained in:
parent
d872b1d9f6
commit
734e5f68d3
7 changed files with 47 additions and 19 deletions
|
@ -746,7 +746,7 @@ FileSerializer::~FileSerializer()
|
|||
if ( io )
|
||||
delete io; // destructor will call close() on fd
|
||||
else if ( fd >= 0 )
|
||||
close(fd);
|
||||
safe_close(fd);
|
||||
}
|
||||
|
||||
bool FileSerializer::Open(const char* file, bool pure)
|
||||
|
@ -810,7 +810,7 @@ void FileSerializer::CloseFile()
|
|||
io->Flush();
|
||||
|
||||
if ( fd >= 0 && ! io ) // destructor of io calls close() on fd
|
||||
close(fd);
|
||||
safe_close(fd);
|
||||
fd = -1;
|
||||
|
||||
delete [] file;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue