summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHenning Baldersheim <balder@yahoo-inc.com>2023-06-08 17:35:16 +0200
committerGitHub <noreply@github.com>2023-06-08 17:35:16 +0200
commit7f71219d78c7b27e388310708bf3362b495d383e (patch)
tree792e9310a0571c11918dcee9a46027b9230a8f32
parentb7833bb65003917b82d0292cf00cf06ac1021046 (diff)
parent9ba0e1e298188f24a4068382252ac82ee74e7ac3 (diff)
Merge pull request #27344 from vespa-engine/arnej/exit-1-on-failure
fix vespa-get-config exit status
-rw-r--r--config/src/apps/vespa-get-config/getconfig.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/config/src/apps/vespa-get-config/getconfig.cpp b/config/src/apps/vespa-get-config/getconfig.cpp
index a31caefe054..b3e89b5d637 100644
--- a/config/src/apps/vespa-get-config/getconfig.cpp
+++ b/config/src/apps/vespa-get-config/getconfig.cpp
@@ -95,6 +95,7 @@ GetConfig::finiRPC()
int
GetConfig::main(int argc, char **argv)
{
+ int retval = 1;
bool debugging = false;
int c = -1;
@@ -120,7 +121,6 @@ GetConfig::main(int argc, char **argv)
int serverPort = 19090;
while ((c = getopt(argc, argv, "a:n:v:g:i:jlm:c:t:V:w:r:s:p:dh")) != -1) {
- int retval = 1;
switch (c) {
case 'a':
schemaString = optarg;
@@ -178,7 +178,7 @@ GetConfig::main(int argc, char **argv)
if (defName == nullptr || serverPort == 0) {
usage(argv[0]);
- return 1;
+ return retval;
}
if (strchr(defName, '.') != nullptr) {
@@ -244,6 +244,7 @@ GetConfig::main(int argc, char **argv)
if (response->isError()) {
fprintf(stderr, "error %d: %s\n",
response->errorCode(), response->errorMessage().c_str());
+ retval = 1;
} else {
response->fill();
ConfigKey rKey(response->getKey());
@@ -271,9 +272,10 @@ GetConfig::main(int argc, char **argv)
printf("%s\n", lines[j].c_str());
}
}
+ retval = 0;
}
finiRPC();
- return 0;
+ return retval;
}
int main(int argc, char **argv) {