#define EOT 4 /* sender end of block transfer */
#define ACK 6 /* target block ack */
#define NAK 21 /* target block negative ack */
-#define CAN 24 /* target/sender transfer cancellation */
#define KWBOOT_XM_BLKSZ 128 /* xmodem block size */
static int
_is_xm_reply(char c)
{
- return c == ACK || c == NAK || c == CAN;
+ return c == ACK || c == NAK;
}
static int
case NAK:
errno = EBADMSG;
break;
- case CAN:
- errno = ECANCELED;
- break;
default:
errno = EPROTO;
break;
do {
rc = kwboot_tty_send(fd, block, sizeof(*block), 1);
if (rc)
- return rc;
+ goto err;
if (allow_non_xm && !*done_print) {
kwboot_progress(100, '.');
allow_non_xm, &non_xm_print,
baudrate, &baud_changed);
if (rc)
- goto can;
+ goto err;
if (!allow_non_xm && c != ACK)
kwboot_progress(-1, '+');
if (allow_non_xm && baudrate && !baud_changed) {
fprintf(stderr, "Baudrate was not changed\n");
- rc = -1;
errno = EPROTO;
- goto can;
+ return -1;
}
return _xm_reply_to_error(c);
-can:
+err:
err = errno;
- kwboot_tty_send_char(fd, CAN);
kwboot_printv("\n");
errno = err;
return rc;