diff options
| author | Warner Losh <imp@FreeBSD.org> | 2006-08-10 17:54:51 +0000 |
|---|---|---|
| committer | Warner Losh <imp@FreeBSD.org> | 2006-08-10 17:54:51 +0000 |
| commit | b51b3172baf0ba4d9a0ec26482801edf67e666c3 (patch) | |
| tree | b76af0aa6bd63d894a406b54d556206c847e5ad6 /sys/boot | |
| parent | 9fd9c34a3feae42f47cc497c5498dae3c5bda36f (diff) | |
Notes
Diffstat (limited to 'sys/boot')
| -rw-r--r-- | sys/boot/arm/at91/libat91/xmodem.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/sys/boot/arm/at91/libat91/xmodem.c b/sys/boot/arm/at91/libat91/xmodem.c index c3903aa1ee71..0c4b1387dcb2 100644 --- a/sys/boot/arm/at91/libat91/xmodem.c +++ b/sys/boot/arm/at91/libat91/xmodem.c @@ -39,6 +39,7 @@ #define CAN 0x18 /* Cancel */ #define EOT 0x04 /* end of text */ +#define TO 10 /* * int GetRecord(char , char *) * This private function receives a x-modem record to the pointer and @@ -53,17 +54,17 @@ GetRecord(char blocknum, char *dest) chk = 0; - if ((ch = getc(1)) == -1) + if ((ch = getc(TO)) == -1) goto err; - if (ch != blocknum) + if (ch != blocknum) goto err; - if ((ch = getc(1)) == -1) + if ((ch = getc(TO)) == -1) goto err; if (ch != (~blocknum & 0xff)) goto err; for (size = 0; size < PACKET_SIZE; ++size) { - if ((ch = getc(1)) == -1) + if ((ch = getc(TO)) == -1) goto err; chk = chk ^ ch << 8; for (j = 0; j < 8; ++j) { @@ -77,10 +78,10 @@ GetRecord(char blocknum, char *dest) chk &= 0xFFFF; - if (((ch = getc(1)) == -1) || ((ch & 0xff) != ((chk >> 8) & 0xFF))) - goto err; - if (((ch = getc(1)) == -1) || ((ch & 0xff) != (chk & 0xFF))) - goto err; + if (((ch = getc(TO)) == -1) || ((ch & 0xff) != ((chk >> 8) & 0xFF))) + goto err; + if (((ch = getc(TO)) == -1) || ((ch & 0xff) != (chk & 0xFF))) + goto err; putchar(ACK); return (1); |
