summaryrefslogtreecommitdiff
path: root/client/client.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-05-30 15:17:52 +0200
committerMaria Matejka <mq@ucw.cz>2022-05-30 15:17:52 +0200
commit097f1571821caa775aec3ada52a1b02b5ffc89bb (patch)
treecd83d27ecbd9f4adb067fc42757c907057c80690 /client/client.c
parent5299fb9db0e3fb75c37f233e9a8b737c46e61265 (diff)
parent692055e3df6cc9f0d428d3b0dd8cdd8e825eb6f4 (diff)
Merge commit '692055e3df6cc9f0d428d3b0dd8cdd8e825eb6f4' into haugesund-to-2.0
Diffstat (limited to 'client/client.c')
-rw-r--r--client/client.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/client/client.c b/client/client.c
index 97cf6639..934e16e0 100644
--- a/client/client.c
+++ b/client/client.c
@@ -50,6 +50,7 @@ static byte *server_read_pos = server_read_buf;
int init = 1; /* During intial sequence */
int busy = 1; /* Executing BIRD command */
int interactive; /* Whether stdin is terminal */
+int last_code; /* Last return code */
static int num_lines, skip_input;
int term_lns, term_cls;
@@ -196,7 +197,7 @@ init_commands(void)
{
/* Initial command is finished and we want to exit */
cleanup();
- exit(0);
+ exit((last_code < 8000) ? 0 : 1);
}
input_init();
@@ -283,6 +284,8 @@ server_got_reply(char *x)
if (code)
PRINTF(len, "%s\n", verbose ? x : x+5);
+ last_code = code;
+
if (x[4] == ' ')
{
busy = 0;