summaryrefslogtreecommitdiffstats
path: root/searchcommon
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2022-01-26 15:41:06 +0000
committerHenning Baldersheim <balder@yahoo-inc.com>2022-01-26 15:59:29 +0000
commit237fe9d1d62d215721f120f5ec6399fc1456119a (patch)
tree64fd0aacaeb15a97b917490277c6e9e5e8bd79cf /searchcommon
parent972de79bfeebf0d9f78a28067969494536d65ca5 (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.cpp9
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;
}