Skip to content

Commit 33e6ec7

Browse files
quic-bjorandeandersson
authored andcommitted
sahara: Print an error when device isn't reachable
Sometimes the device ends up in a funky state, resulting in the initial USB read to fail. Rather then just silently exiting with an error code, actually print a message to inform the user. Signed-off-by: Bjorn Andersson <[email protected]>
1 parent 841a0a8 commit 33e6ec7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sahara.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -452,8 +452,10 @@ int sahara_run(struct qdl_device *qdl, char *img_arr[], bool single_image,
452452

453453
while (!done) {
454454
n = qdl_read(qdl, buf, sizeof(buf), 1000);
455-
if (n < 0)
455+
if (n < 0) {
456+
ux_err("failed to read sahara request from device\n");
456457
break;
458+
}
457459

458460
pkt = (struct sahara_pkt *)buf;
459461
if (n != pkt->length) {

0 commit comments

Comments
 (0)