X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=firmware%2Fihex2fw.c;h=cf38e159131a1c2344533391a1a0077ad9764b14;hb=ec08bdb148767f1193f5f3028749ed865ac27181;hp=ba0cf0b601bb925fc3ce514d1f1dd55569feac91;hpb=bc030d6cb9532877c1c5a3f5e7123344fa24a285;p=pandora-kernel.git diff --git a/firmware/ihex2fw.c b/firmware/ihex2fw.c index ba0cf0b601bb..cf38e159131a 100644 --- a/firmware/ihex2fw.c +++ b/firmware/ihex2fw.c @@ -124,8 +124,7 @@ int main(int argc, char **argv) if (process_ihex(data, st.st_size)) return 1; - output_records(outfd); - return 0; + return output_records(outfd); } static int process_ihex(uint8_t *data, ssize_t size) @@ -269,11 +268,13 @@ static int output_records(int outfd) p->addr = htonl(p->addr); p->len = htons(p->len); - write(outfd, &p->addr, writelen); + if (write(outfd, &p->addr, writelen) != writelen) + return 1; p = p->next; } /* EOF record is zero length, since we don't bother to represent the type field in the binary version */ - write(outfd, zeroes, 6); + if (write(outfd, zeroes, 6) != 6) + return 1; return 0; }