diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2010-11-24 12:00:55 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2010-11-24 12:00:55 -0800 |
commit | 60192694d82b0f6b34d3a8be846e0f81893e8a9b (patch) | |
tree | 96fe55b42a79e0506c159e309d16fd6318d915cc /src | |
parent | 6c744b0ba23a616f00d63e12daf10a4fcd187cfa (diff) | |
download | vyatta-cfg-60192694d82b0f6b34d3a8be846e0f81893e8a9b.tar.gz vyatta-cfg-60192694d82b0f6b34d3a8be846e0f81893e8a9b.zip |
use exit code 1 to ease init script usage
Diffstat (limited to 'src')
-rw-r--r-- | src/cli_bin.cpp | 2 | ||||
-rw-r--r-- | src/cli_new.c | 2 | ||||
-rw-r--r-- | src/cli_shell_api.cpp | 30 |
3 files changed, 17 insertions, 17 deletions
diff --git a/src/cli_bin.cpp b/src/cli_bin.cpp index 5823c02..9528277 100644 --- a/src/cli_bin.cpp +++ b/src/cli_bin.cpp @@ -206,7 +206,7 @@ main(int argc, char **argv) } if (op_idx == -1) { printf("Invalid operation\n"); - exit(-1); + exit(1); } if (initialize_output(OP_Str) == -1) { diff --git a/src/cli_new.c b/src/cli_new.c index 41afb5f..1ac99a1 100644 --- a/src/cli_new.c +++ b/src/cli_new.c @@ -129,7 +129,7 @@ void bye(const char *msg, ...) printf(is_echo()? "\";":"\n"); va_end(ap); - exit(-1); + exit(1); } /* msg: diff --git a/src/cli_shell_api.cpp b/src/cli_shell_api.cpp index 02340bf..af0a320 100644 --- a/src/cli_shell_api.cpp +++ b/src/cli_shell_api.cpp @@ -82,7 +82,7 @@ getEditEnv(const vector<string>& args) UnionfsCstore cstore(true); string env; if (!cstore.getEditEnv(args, env)) { - exit(-1); + exit(1); } printf("%s", env.c_str()); } @@ -94,7 +94,7 @@ getEditUpEnv(const vector<string>& args) UnionfsCstore cstore(true); string env; if (!cstore.getEditUpEnv(env)) { - exit(-1); + exit(1); } printf("%s", env.c_str()); } @@ -106,7 +106,7 @@ getEditResetEnv(const vector<string>& args) UnionfsCstore cstore(true); string env; if (!cstore.getEditResetEnv(env)) { - exit(-1); + exit(1); } printf("%s", env.c_str()); } @@ -125,7 +125,7 @@ getCompletionEnv(const vector<string>& args) UnionfsCstore cstore(true); string env; if (!cstore.getCompletionEnv(args, env)) { - exit(-1); + exit(1); } printf("%s", env.c_str()); } @@ -145,7 +145,7 @@ markSessionUnsaved(const vector<string>& args) { UnionfsCstore cstore(true); if (!cstore.markSessionUnsaved()) { - exit(-1); + exit(1); } } @@ -154,7 +154,7 @@ unmarkSessionUnsaved(const vector<string>& args) { UnionfsCstore cstore(true); if (!cstore.unmarkSessionUnsaved()) { - exit(-1); + exit(1); } } @@ -163,7 +163,7 @@ sessionUnsaved(const vector<string>& args) { UnionfsCstore cstore(true); if (!cstore.sessionUnsaved()) { - exit(-1); + exit(1); } } @@ -172,7 +172,7 @@ sessionChanged(const vector<string>& args) { UnionfsCstore cstore(true); if (!cstore.sessionChanged()) { - exit(-1); + exit(1); } } @@ -181,7 +181,7 @@ teardownSession(const vector<string>& args) { UnionfsCstore cstore(true); if (!cstore.teardownSession()) { - exit(-1); + exit(1); } } @@ -190,7 +190,7 @@ setupSession(const vector<string>& args) { UnionfsCstore cstore(true); if (!cstore.setupSession()) { - exit(-1); + exit(1); } } @@ -199,7 +199,7 @@ inSession(const vector<string>& args) { UnionfsCstore cstore(true); if (!cstore.inSession()) { - exit(-1); + exit(1); } } @@ -495,7 +495,7 @@ main(int argc, char **argv) int i = 0; if (nargs < 0) { fprintf(stderr, "Must specify operation\n"); - exit(-1); + exit(1); } while (ops[i].op_name) { if (strcmp(oname, ops[i].op_name) == 0) { @@ -506,15 +506,15 @@ main(int argc, char **argv) } if (op_idx == -1) { fprintf(stderr, "Invalid operation\n"); - exit(-1); + exit(1); } if (OP_exact_args >= 0 && nargs != OP_exact_args) { fprintf(stderr, "%s\n", OP_exact_error); - exit(-1); + exit(1); } if (OP_min_args >= 0 && nargs < OP_min_args) { fprintf(stderr, "%s\n", OP_min_error); - exit(-1); + exit(1); } vector<string> args; |