From 72c373451c3e50f2357308a97ce2e806bf439bba Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Sun, 28 Jun 2020 23:43:59 -0700 Subject: [PATCH] cdba: Exit nicely on communication error Receiving an invalid command should lead to termination of the client, but doing so abruptly will cause the termios not to be reset. Signed-off-by: Bjorn Andersson --- cdba.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cdba.c b/cdba.c index 2b08869..fa87a38 100644 --- a/cdba.c +++ b/cdba.c @@ -453,7 +453,7 @@ static int handle_message(struct circ_buf *buf) break; default: fprintf(stderr, "unk %d len %d\n", msg->type, msg->len); - exit(1); + return -1; } free(msg);