summaryrefslogtreecommitdiffstats
path: root/firmware/ihex2fw.c
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2011-01-19 23:51:37 +0100
committerPatrick McHardy <kaber@trash.net>2011-01-19 23:51:37 +0100
commit14f0290ba44de6ed435fea24bba26e7868421c66 (patch)
tree449d32e4848007e3edbcab14fa8e09fdc66608ed /firmware/ihex2fw.c
parentnetfilter: nf_conntrack: fix lifetime display for disabled connections (diff)
parentMerge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/ne... (diff)
downloadlinux-14f0290ba44de6ed435fea24bba26e7868421c66.tar.xz
linux-14f0290ba44de6ed435fea24bba26e7868421c66.zip
Merge branch 'master' of /repos/git/net-next-2.6
Diffstat (limited to 'firmware/ihex2fw.c')
-rw-r--r--firmware/ihex2fw.c9
1 files changed, 5 insertions, 4 deletions
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;
}