aboutsummaryrefslogtreecommitdiffstats
path: root/searchlib
diff options
context:
space:
mode:
authorTor Egge <Tor.Egge@yahooinc.com>2023-07-13 21:36:33 +0200
committerTor Egge <Tor.Egge@yahooinc.com>2023-07-13 21:36:33 +0200
commit663baa82d8d89fba8a0f30a283459081dbf08daa (patch)
tree36fde7e55f371913238590e2e1d422be92f6290f /searchlib
parent642d4c4ec3c3e51a2079f3cf4b55da664d4be52c (diff)
Fail when unable to open file.
Diffstat (limited to 'searchlib')
-rw-r--r--searchlib/src/vespa/searchlib/diskindex/bitvectorfile.cpp5
-rw-r--r--searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.cpp5
2 files changed, 4 insertions, 6 deletions
diff --git a/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.cpp b/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.cpp
index 4ae0ce2621a..f4d129bfc58 100644
--- a/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.cpp
+++ b/searchlib/src/vespa/searchlib/diskindex/bitvectorfile.cpp
@@ -22,7 +22,7 @@ readHeader(vespalib::FileHeader &h,
const vespalib::string &name)
{
Fast_BufferedFile file(32_Ki);
- file.OpenReadOnly(name.c_str());
+ file.ReadOpenExisting(name.c_str());
h.readFile(file);
}
@@ -58,8 +58,7 @@ BitVectorFileWrite::open(const vespalib::string &name,
if (tuneFileWrite.getWantDirectIO()) {
_datFile->EnableDirectIO();
}
- // XXX no checking for success:
- _datFile->OpenWriteOnly(datname.c_str());
+ _datFile->WriteOpen(datname.c_str());
if (_datHeaderLen == 0) {
assert(_numKeys == 0);
diff --git a/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.cpp b/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.cpp
index 6913c03262c..0caf89a0730 100644
--- a/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.cpp
+++ b/searchlib/src/vespa/searchlib/diskindex/bitvectoridxfile.cpp
@@ -20,7 +20,7 @@ void
readHeader(vespalib::FileHeader &h, const vespalib::string &name)
{
Fast_BufferedFile file(32_Ki);
- file.OpenReadOnly(name.c_str());
+ file.ReadOpenExisting(name.c_str());
h.readFile(file);
}
@@ -66,8 +66,7 @@ BitVectorIdxFileWrite::open(const vespalib::string &name,
_idxFile->EnableDirectIO();
}
- // XXX no checking for success:
- _idxFile->OpenWriteOnly(idxname.c_str());
+ _idxFile->WriteOpen(idxname.c_str());
if (_idxHeaderLen == 0) {
assert(_numKeys == 0);