diff options
author | Maria Matejka <mq@ucw.cz> | 2022-05-30 15:36:54 +0200 |
---|---|---|
committer | Maria Matejka <mq@ucw.cz> | 2022-05-30 15:36:54 +0200 |
commit | 45af19dd99b3c8f954621e09075e8be180e2f731 (patch) | |
tree | 2e25c82a8e13080d589c79ec0478e5127a9404fb /client/client.c | |
parent | ef3a8138c909baf58c61ddf2edd815eab899d3a6 (diff) | |
parent | 652be92a21f5575e5f74f6abe98eb4200b86776c (diff) |
Merge commit '652be92a21f5575e5f74f6abe98eb4200b86776c' into haugesund
Diffstat (limited to 'client/client.c')
-rw-r--r-- | client/client.c | 5 |
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; |