Skip to content

Commit

Permalink
ihex: fix unused return value compiler warning
Browse files Browse the repository at this point in the history
Fix unusued return value compiler warnings due to unchecked write() calls.

[[email protected]: correctly handle short writes]
Signed-off-by: Chris Ruffin <[email protected]>
Cc: Mark Brown <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Chris Ruffin authored and torvalds committed Jan 13, 2011
1 parent 8369744 commit b8cb464
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions firmware/ihex2fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}

0 comments on commit b8cb464

Please sign in to comment.