diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-07-28 15:04:56 -0700 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2009-06-18 20:18:24 +0100 |
commit | 2c4d48bc018c5bdca6faa953fbf6ff828becbc45 (patch) | |
tree | 192ce26802145423ab7ede7d30cba375edf6a5b3 | |
parent | 57fb974856b9ae143ca5642e279d181a45bbdd10 (diff) |
[vtysh] Return non-zero exit code on error.
If passed a bad command, return non-zero exit code
-rw-r--r-- | vtysh/vtysh.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/vtysh/vtysh.c b/vtysh/vtysh.c index 20f7df44..bff06323 100644 --- a/vtysh/vtysh.c +++ b/vtysh/vtysh.c @@ -275,7 +275,7 @@ vtysh_pager_init (void) static int vtysh_execute_func (const char *line, int pager) { - int ret, cmd_stat = CMD_SUCCESS; + int ret, cmd_stat; u_int i; vector vline; struct cmd_element *cmd; @@ -336,6 +336,7 @@ vtysh_execute_func (const char *line, int pager) cmd_free_strvec (vline); + cmd_stat = ret; switch (ret) { case CMD_WARNING: |