diff options
author | Arne Juul <arnej@verizonmedia.com> | 2020-07-02 12:33:56 +0000 |
---|---|---|
committer | Arne Juul <arnej@verizonmedia.com> | 2020-07-03 08:02:39 +0000 |
commit | 0a309ca9dcba4fed2ba8e4c56230330859a70148 (patch) | |
tree | 91ec1ed6bdc855392cd7fbce4f5f03942dfc8942 /searchcore | |
parent | 8440cd09772a8fb8174915af9c4fb786dcf2cff0 (diff) |
avoid naked exit
Diffstat (limited to 'searchcore')
-rw-r--r-- | searchcore/src/apps/vespa-proton-cmd/vespa-proton-cmd.cpp | 9 |
1 files changed, 5 insertions, 4 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 ""; } |