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 <bjorn.andersson@linaro.org>
This commit is contained in:
Bjorn Andersson
2019-10-23 21:44:32 -07:00
parent 47399e9765
commit 3554179153

4
bad.c
View File

@@ -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));
}