diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2022-01-26 15:41:06 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2022-01-26 15:59:29 +0000 |
commit | 237fe9d1d62d215721f120f5ec6399fc1456119a (patch) | |
tree | 64fd0aacaeb15a97b917490277c6e9e5e8bd79cf /searchcommon | |
parent | 972de79bfeebf0d9f78a28067969494536d65ca5 (diff) |
- assert result of Close() in destructor of FastOS_File and FastOS_BufferedFile.
- Check result of Close()
- Check result of Sync()
- Scope FastOS_File to avoid explicit Close().
- NULL -> nullptr
Diffstat (limited to 'searchcommon')
-rw-r--r-- | searchcommon/src/vespa/searchcommon/common/schema.cpp | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/searchcommon/src/vespa/searchcommon/common/schema.cpp b/searchcommon/src/vespa/searchcommon/common/schema.cpp index af730f38018..0127f727069 100644 --- a/searchcommon/src/vespa/searchcommon/common/schema.cpp +++ b/searchcommon/src/vespa/searchcommon/common/schema.cpp @@ -290,18 +290,13 @@ Schema::saveToFile(const vespalib::string & fileName) const FastOS_File s; s.OpenReadWrite(fileName.c_str()); if (!s.IsOpened()) { - LOG(warning, - "Could not open schema file '%s' for fsync", - fileName.c_str()); + LOG(warning, "Could not open schema file '%s' for fsync", fileName.c_str()); return false; } else { if (!s.Sync()) { - LOG(warning, - "Could not fsync schema file '%s'", - fileName.c_str()); + LOG(warning, "Could not fsync schema file '%s'", fileName.c_str()); return false; } - s.Close(); } return true; } |