diff options
3 files changed, 29 insertions, 39 deletions
diff --git a/searchcore/src/apps/vespa-proton-cmd/vespa-proton-cmd.cpp b/searchcore/src/apps/vespa-proton-cmd/vespa-proton-cmd.cpp index dcd3dce218b..c669f90ae2c 100644 --- a/searchcore/src/apps/vespa-proton-cmd/vespa-proton-cmd.cpp +++ b/searchcore/src/apps/vespa-proton-cmd/vespa-proton-cmd.cpp @@ -10,6 +10,7 @@ #include <vespa/fastos/app.h> #include <sys/time.h> #include <thread> +#include <cstdlib> #include <vespa/log/log.h> LOG_SETUP("vespa-proton-cmd"); @@ -123,7 +124,7 @@ public: if (!sbmirror.ready()) { fprintf(stderr, "ERROR: no data from service location broker\n"); - exit(1); + std::_Exit(1); } slobrok::api::MirrorAPI::SpecList specs = sbmirror.lookup(rtcPattern); slobrok::api::MirrorAPI::SpecList specs2 = sbmirror.lookup(rtcPattern2); @@ -140,7 +141,7 @@ public: scanSpecs(specs3, me, service, spec, found); if (found > 1) { fprintf(stderr, "found more than one local RTC, you must use --id=<name>\n"); - exit(1); + std::_Exit(1); } if (found < 1) { fprintf(stderr, "found no local RTC, you must use --id=<name> (list follows):\n"); @@ -148,12 +149,12 @@ public: printf("RTC name %s with connection spec %s\n", specs[j].first.c_str(), specs[j].second.c_str()); } - exit(1); + std::_Exit(1); } return spec; } catch (config::InvalidConfigException& e) { fprintf(stderr, "ERROR: failed to get service location broker configuration\n"); - exit(1); + std::_Exit(1); } return ""; } diff --git a/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp b/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp index 90953f78c40..06fb5e71e06 100644 --- a/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp +++ b/searchlib/src/apps/vespa-index-inspect/vespa-index-inspect.cpp @@ -15,6 +15,7 @@ #include <vespa/fastos/app.h> #include <iostream> #include <getopt.h> +#include <cstdlib> #include <vespa/log/log.h> LOG_SETUP("vespa-index-inspect"); @@ -153,10 +154,8 @@ FieldOptions::validateFields(const Schema &schema) i != ie; ++i) { uint32_t fieldId = schema.getIndexFieldId(*i); if (fieldId == Schema::UNKNOWN_FIELD_ID) { - LOG(error, - "No such field: %s", - i->c_str()); - exit(1); + LOG(error, "No such field: %s", i->c_str()); + std::_Exit(1); } _ids.push_back(fieldId); } @@ -465,7 +464,7 @@ ShowPostingListSubApp::showTransposedPostingList() if (!schema.loadFromFile(schemaName)) { LOG(error, "Could not load schema from %s", schemaName.c_str()); - exit(1); + std::_Exit(1); } _fieldOptions.validateFields(schema); if (!readDocIdLimit(schema)) @@ -538,14 +537,14 @@ ShowPostingListSubApp::showPostingList() if (!schema.loadFromFile(schemaName)) { LOG(error, "Could not load schema from %s", schemaName.c_str()); - exit(1); + std::_Exit(1); } _fieldOptions.validateFields(schema); if (_fieldOptions._ids.size() != 1) { LOG(error, "Wrong number of field arguments: %d", static_cast<int>(_fieldOptions._ids.size())); - exit(1); + std::_Exit(1); } SchemaUtil::IndexIterator it(schema, _fieldOptions._ids.front()); @@ -559,26 +558,22 @@ ShowPostingListSubApp::showPostingList() if (_readmmap) tuneFileRead.setWantMemoryMap(); if (!dict->open(dictName, tuneFileRead)) { - LOG(error, - "Could not open dictionary %s", - dictName.c_str()); - exit(1); + LOG(error, "Could not open dictionary %s", dictName.c_str()); + std::_Exit(1); } std::unique_ptr<PostingListFileRandRead> postingfile(new Zc4PosOccRandRead); std::string mangledName = _indexDir + "/" + shortName + "/posocc.dat.compressed"; if (!postingfile->open(mangledName, tuneFileRead)) { - LOG(error, - "Could not open posting list file %s", - mangledName.c_str()); - exit(1); + LOG(error, "Could not open posting list file %s", mangledName.c_str()); + std::_Exit(1); } PostingListOffsetAndCounts offsetAndCounts; uint64_t wordNum = 0; bool res = dict->lookup(_word, wordNum, offsetAndCounts); if (!res) { LOG(warning, "Unknown word %s", _word.c_str()); - exit(1); + std::_Exit(1); } if (_verbose) { LOG(info, @@ -650,15 +645,13 @@ ShowPostingListSubApp::showPostingList() } if (!postingfile->close()) { - LOG(error, - "Could not close posting list file %s", + LOG(error, "Could not close posting list file %s", mangledName.c_str()); - exit(1); + std::_Exit(1); } if (!dict->close()) { - LOG(error, - "Could not close dictionary %s", dictName.c_str()); - exit(1); + LOG(error, "Could not close dictionary %s", dictName.c_str()); + std::_Exit(1); } } @@ -797,16 +790,14 @@ DumpWordsSubApp::dumpWords() search::index::Schema schema; std::string schemaName = _indexDir + "/schema.txt"; if (!schema.loadFromFile(schemaName)) { - LOG(error, - "Could not load schema from %s", schemaName.c_str()); - exit(1); + LOG(error, "Could not load schema from %s", schemaName.c_str()); + std::_Exit(1); } _fieldOptions.validateFields(schema); if (_fieldOptions._ids.size() != 1) { - LOG(error, - "Wrong number of field arguments: %d", + LOG(error, "Wrong number of field arguments: %d", static_cast<int>(_fieldOptions._ids.size())); - exit(1); + std::_Exit(1); } SchemaUtil::IndexIterator index(schema, _fieldOptions._ids[0]); @@ -815,9 +806,8 @@ DumpWordsSubApp::dumpWords() std::string wordListName = fieldDir + "/dictionary"; search::TuneFileSeqRead tuneFileRead; if (!wordList.open(wordListName, tuneFileRead)) { - LOG(error, - "Could not open wordlist %s", wordListName.c_str()); - exit(1); + LOG(error, "Could not open wordlist %s", wordListName.c_str()); + std::_Exit(1); } uint64_t wordNum = 0; vespalib::string word; @@ -838,9 +828,8 @@ DumpWordsSubApp::dumpWords() std::cout << '\n'; } if (!wordList.close()) { - LOG(error, - "Could not close wordlist %s", wordListName.c_str()); - exit(1); + LOG(error, "Could not close wordlist %s", wordListName.c_str()); + std::_Exit(1); } } diff --git a/searchlib/src/tests/tensor/hnsw_index/stress_hnsw_mt.cpp b/searchlib/src/tests/tensor/hnsw_index/stress_hnsw_mt.cpp index 1e10d94bb18..9c896396de3 100644 --- a/searchlib/src/tests/tensor/hnsw_index/stress_hnsw_mt.cpp +++ b/searchlib/src/tests/tensor/hnsw_index/stress_hnsw_mt.cpp @@ -82,7 +82,7 @@ void read_vector_file(MallocPointVector *p) { int fd = open(fn.c_str(), O_RDONLY); if (fd < 0) { perror(fn.c_str()); - exit(1); + std::_Exit(1); } int d; size_t rv; |