diff options
author | Pali Rohár <pali@kernel.org> | 2022-01-25 18:13:06 +0100 |
---|---|---|
committer | Stefan Roese <sr@denx.de> | 2022-01-31 10:23:38 +0100 |
commit | 5d8aa4c92b86dcdbdb7c9fcf12e6c93c87e16555 (patch) | |
tree | 1410a5627ede06d78548ad9b2bafa1b29c3e54d9 /tools/kwboot.c | |
parent | 5875ad48e2c5119c629da3751c49ad5e3f0c96b0 (diff) | |
download | u-boot-5d8aa4c92b86dcdbdb7c9fcf12e6c93c87e16555.zip u-boot-5d8aa4c92b86dcdbdb7c9fcf12e6c93c87e16555.tar.gz u-boot-5d8aa4c92b86dcdbdb7c9fcf12e6c93c87e16555.tar.bz2 |
tools: kwboot: Show 'E' in progress output when error occurs
When kwboot is unable to resend current xmodem packet, show an 'E' in the
progress output instead of a '+'. This allows to distinguish between the
state when kwboot is retrying sending the packet and when retry is not
possible.
Signed-off-by: Pali Rohár <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'tools/kwboot.c')
-rw-r--r-- | tools/kwboot.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/kwboot.c b/tools/kwboot.c index dfac8ae..1dcec19 100644 --- a/tools/kwboot.c +++ b/tools/kwboot.c @@ -975,8 +975,12 @@ kwboot_xm_sendblock(int fd, struct kwboot_block *block, int allow_non_xm, if (rc) goto err; - if (!allow_non_xm && c != ACK) - kwboot_progress(-1, '+'); + if (!allow_non_xm && c != ACK) { + if (c == NAK && allow_retries && retries + 1 < 16) + kwboot_progress(-1, '+'); + else + kwboot_progress(-1, 'E'); + } } while (c == NAK && allow_retries && retries++ < 16); if (non_xm_print) |