summaryrefslogtreecommitdiff
path: root/client/client.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@ucw.cz>2022-08-02 17:58:14 +0200
committerMaria Matejka <mq@ucw.cz>2022-08-02 17:58:14 +0200
commit0072d11f3431165240656edf6ade473554b8747e (patch)
tree6c53bbbf0d3a4a3ad70846aae50995dc184cc5a5 /client/client.c
parent2e95d269d6bd42372d3273264e14775242b0744d (diff)
parentdb9153e216b6f1847ac9cdf170b1d14c04552e41 (diff)
Merge branch 'ballygarvan' into HEAD
Replacing the old 3.0-alpha0 cork mechanism with another one inside the routing table. This version should be simpler and also quite clear what it does, why and when.
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;