diff options
4 files changed, 12 insertions, 9 deletions
diff --git a/searchlib/src/vespa/searchlib/attribute/attributefilewriter.cpp b/searchlib/src/vespa/searchlib/attribute/attributefilewriter.cpp index 91eb229b271..8a3885393b3 100644 --- a/searchlib/src/vespa/searchlib/attribute/attributefilewriter.cpp +++ b/searchlib/src/vespa/searchlib/attribute/attributefilewriter.cpp @@ -155,8 +155,10 @@ void AttributeFileWriter::close() { if (_file->IsOpened()) { - _file->Sync(); - _file->Close(); + bool synk_ok = _file->Sync(); + assert(synk_ok); + bool close_ok = _file->Close(); + assert(close_ok); updateHeader(_file->GetFileName(), _fileBitSize); } } diff --git a/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.cpp b/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.cpp index 30fc85d47f0..c8374610dea 100644 --- a/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/pagedict4randread.cpp @@ -255,10 +255,10 @@ PageDict4RandRead::close() _ssReadContext.dropComprBuf(); _ssReadContext.setFile(nullptr); - _ssfile->Close(); - _spfile->Close(); - _pfile->Close(); - return true; + bool ok = _ssfile->Close(); + ok &= _spfile->Close(); + ok &= _pfile->Close(); + return ok; } uint64_t diff --git a/searchlib/src/vespa/searchlib/diskindex/zcposoccrandread.cpp b/searchlib/src/vespa/searchlib/diskindex/zcposoccrandread.cpp index 7be66db9fec..4ed72c2f8c3 100644 --- a/searchlib/src/vespa/searchlib/diskindex/zcposoccrandread.cpp +++ b/searchlib/src/vespa/searchlib/diskindex/zcposoccrandread.cpp @@ -175,8 +175,7 @@ open(const vespalib::string &name, const TuneFileRandRead &tuneFileRead) bool ZcPosOccRandRead::close() { - _file->Close(); - return true; + return _file->Close(); } diff --git a/searchlib/src/vespa/searchlib/util/file_with_header.cpp b/searchlib/src/vespa/searchlib/util/file_with_header.cpp index b004f2b29d5..8fc0f703199 100644 --- a/searchlib/src/vespa/searchlib/util/file_with_header.cpp +++ b/searchlib/src/vespa/searchlib/util/file_with_header.cpp @@ -5,6 +5,7 @@ #include "filesizecalculator.h" #include <vespa/fastos/file.h> #include <vespa/vespalib/util/size_literals.h> +#include <cassert> namespace search { @@ -52,7 +53,8 @@ FileWithHeader::rewind() void FileWithHeader::close() { - _file->Close(); + bool close_ok = _file->Close(); + assert(close_ok); } |