diff options
author | Patrick McHardy <kaber@trash.net> | 2011-01-19 17:51:37 -0500 |
---|---|---|
committer | Patrick McHardy <kaber@trash.net> | 2011-01-19 17:51:37 -0500 |
commit | 14f0290ba44de6ed435fea24bba26e7868421c66 (patch) | |
tree | 449d32e4848007e3edbcab14fa8e09fdc66608ed /firmware | |
parent | f5c88f56b35599ab9ff2d3398e0153e4cd4a4c82 (diff) | |
parent | a5db219f4cf9f67995eabd53b81a1232c82f5852 (diff) |
Merge branch 'master' of /repos/git/net-next-2.6
Diffstat (limited to 'firmware')
-rw-r--r-- | firmware/ihex2fw.c | 9 |
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) | |||
124 | if (process_ihex(data, st.st_size)) | 124 | if (process_ihex(data, st.st_size)) |
125 | return 1; | 125 | return 1; |
126 | 126 | ||
127 | output_records(outfd); | 127 | return output_records(outfd); |
128 | return 0; | ||
129 | } | 128 | } |
130 | 129 | ||
131 | static int process_ihex(uint8_t *data, ssize_t size) | 130 | static int process_ihex(uint8_t *data, ssize_t size) |
@@ -269,11 +268,13 @@ static int output_records(int outfd) | |||
269 | 268 | ||
270 | p->addr = htonl(p->addr); | 269 | p->addr = htonl(p->addr); |
271 | p->len = htons(p->len); | 270 | p->len = htons(p->len); |
272 | write(outfd, &p->addr, writelen); | 271 | if (write(outfd, &p->addr, writelen) != writelen) |
272 | return 1; | ||
273 | p = p->next; | 273 | p = p->next; |
274 | } | 274 | } |
275 | /* EOF record is zero length, since we don't bother to represent | 275 | /* EOF record is zero length, since we don't bother to represent |
276 | the type field in the binary version */ | 276 | the type field in the binary version */ |
277 | write(outfd, zeroes, 6); | 277 | if (write(outfd, zeroes, 6) != 6) |
278 | return 1; | ||
278 | return 0; | 279 | return 0; |
279 | } | 280 | } |