X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=tools%2Fkwboot.c;h=50ae2b4b77b1e3702b92f884979bc7808893e479;hb=9e1e6f6fe8d4fab523c7b211a7377167dbdcb707;hp=e00958a4ce593cb9060e84b03dc365311b7acc20;hpb=7497a6a1f13eb86d68a936edecfd682bbad5752d;p=oweals%2Fu-boot.git diff --git a/tools/kwboot.c b/tools/kwboot.c index e00958a4ce..50ae2b4b77 100644 --- a/tools/kwboot.c +++ b/tools/kwboot.c @@ -182,7 +182,7 @@ kwboot_tty_recv(int fd, void *buf, size_t len, int timeo) } n = read(fd, buf, len); - if (n < 0) + if (n <= 0) goto out; buf = (char *)buf + n; @@ -466,7 +466,7 @@ kwboot_term_pipe(int in, int out, char *quit, int *s) char _buf[128], *buf = _buf; nin = read(in, buf, sizeof(buf)); - if (nin < 0) + if (nin <= 0) return -1; if (quit) { @@ -655,14 +655,6 @@ kwboot_img_patch_hdr(void *img, size_t size) hdr->blockid = IBR_HDR_UART_ID; - /* - * Subtract mkimage header size from destination address - * as this header is not expected by the Marvell BootROM. - * This way, the execution address is identical to the - * one the image is compiled for (TEXT_BASE). - */ - hdr->destaddr = hdr->destaddr - sizeof(struct image_header); - if (image_ver == 0) { struct main_hdr_v0 *hdr_v0 = img; @@ -829,7 +821,7 @@ main(int argc, char **argv) perror("debugmsg"); goto out; } - } else { + } else if (bootmsg) { rc = kwboot_bootmsg(tty, bootmsg); if (rc) { perror("bootmsg");