diff options
author | Arne Juul <arnej@verizonmedia.com> | 2020-07-02 12:34:14 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2020-07-03 08:02:40 +0000 |
commit | 50cfc6e40bb1a6e968c77e8ee89990b891e22c13 (patch) | |
tree | 471d29baefae44465e8b148b7ec24302f4131fc6 | |
parent | fca385ca81ea92e6b9dbbb0d1794cfafa35ababc (diff) |
avoid naked exit
3 files changed, 4 insertions, 3 deletions
diff --git a/storage/src/vespa/storage/tools/generatedistributionbits.cpp b/storage/src/vespa/storage/tools/generatedistributionbits.cpp index 98c5e56b90c..0885483f674 100644 --- a/storage/src/vespa/storage/tools/generatedistributionbits.cpp +++ b/storage/src/vespa/storage/tools/generatedistributionbits.cpp @@ -128,7 +128,7 @@ int main(int argc, char** argv) { std::cerr << e.getMessage() << "\n\n"; o.writeSyntaxPage(std::cerr); std::cerr << "\n"; - exit(1); + return 1; } o.finalize(); if (o.printHtml) { std::cout << "<b>"; } diff --git a/storageapi/src/vespa/storageapi/app/getbucketid.cpp b/storageapi/src/vespa/storageapi/app/getbucketid.cpp index 25c2fd2fc37..4f6552ac3f0 100644 --- a/storageapi/src/vespa/storageapi/app/getbucketid.cpp +++ b/storageapi/src/vespa/storageapi/app/getbucketid.cpp @@ -7,7 +7,7 @@ int main(int argc, char** argv) { if (argc != 2) { std::cerr << "Usage: getbucketid <documentid>\n"; - exit(1); + return 1; } document::BucketIdFactory factory; document::BucketId id = factory.getBucketId(document::DocumentId(argv[1])); diff --git a/vespaclient/src/vespa/vespaclient/vdsstates/statesapp.cpp b/vespaclient/src/vespa/vespaclient/vdsstates/statesapp.cpp index 1b8f31f0d03..082aa83c3da 100644 --- a/vespaclient/src/vespa/vespaclient/vdsstates/statesapp.cpp +++ b/vespaclient/src/vespa/vespaclient/vdsstates/statesapp.cpp @@ -15,6 +15,7 @@ #include <sstream> #include <iostream> #include <thread> +#include <cstdlib> #include <sys/time.h> #include <vespa/log/log.h> @@ -128,7 +129,7 @@ struct Options : public vespalib::ProgramOptions { _clusterName = _cluster.getName(); } catch (const vespaclient::ClusterList::ClusterNotFoundException& e) { std::cerr << e.getMessage() << "\n"; - exit(1); + std::_Exit(1); } return true; } |