From 3554179153ebdc0353919dc497dafdf223d4e6bd Mon Sep 17 00:00:00 2001 From: Bjorn Andersson Date: Wed, 23 Oct 2019 21:44:32 -0700 Subject: [PATCH] bad: Disconnect link when select board fails Exit bad as it fails to open a board, so that we don't just rely on the client to read this message and close the link. Signed-off-by: Bjorn Andersson --- bad.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/bad.c b/bad.c index 2598c33..bf0388a 100644 --- a/bad.c +++ b/bad.c @@ -95,8 +95,10 @@ static void msg_select_board(const void *param) struct msg reply = { MSG_SELECT_BOARD, 0 }; selected_device = device_open(param, &fastboot_ops); - if (!selected_device) + if (!selected_device) { fprintf(stderr, "failed to open %s\n", (const char *)param); + quit_invoked = true; + } write(STDOUT_FILENO, &reply, sizeof(reply)); }