fastboot: Don't tear down link when fastboot download fails

There are cases where fastboot simply disconnects, where it makes sense
to maintain the cdba connection, so return gracefully from
fastboot_download() when this happens.

Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
This commit is contained in:
Bjorn Andersson
2018-11-30 11:02:14 -08:00
parent 8306649692
commit fcfb7ad05f

View File

@@ -375,8 +375,10 @@ int fastboot_download(struct fastboot *fb, const void *data, size_t len)
fastboot_write(fb, cmd, n);
n = fastboot_read(fb, buf, MAX_USBFS_BULK_SIZE);
if (n < 0)
errx(1, "remote rejected download request");
if (n < 0) {
fprintf(stderr, "remote rejected download request\n");
return -1;
}
while (len > 0) {
xfer = MIN(len, MAX_USBFS_BULK_SIZE);