summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorArne Juul <arnej@yahooinc.com>2023-06-08 10:15:45 +0000
committerArne Juul <arnej@yahooinc.com>2023-06-08 10:15:45 +0000
commit9ba0e1e298188f24a4068382252ac82ee74e7ac3 (patch)
tree0b01a5e50c0a5b2c95590471494bff57200f7fc3 /config
parent92e37cb2eb70d763eaebf6b26992bf6c74bcadfb (diff)
fix vespa-get-config exit status
Diffstat (limited to 'config')
-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) {