From: Chris Ruffin <cmruffin@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>,
Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: linux-kernel@vger.kernel.org, Chris Ruffin <cmruffin@gmail.com>
Subject: [PATCH] ihex: fix unused return value compiler warning.
Date: Sun, 2 Jan 2011 11:27:10 -0800 [thread overview]
Message-ID: <1293996430-12598-1-git-send-email-cmruffin@gmail.com> (raw)
fixed unusued return value compiler warnings due to unchecked write() calls.
Signed-off-by: Chris Ruffin <cmruffin@gmail.com>
---
firmware/ihex2fw.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/firmware/ihex2fw.c b/firmware/ihex2fw.c
index ba0cf0b..a079bdd 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 errno;
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 errno;
return 0;
}
--
1.7.1
next reply other threads:[~2011-01-02 19:27 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-02 19:27 Chris Ruffin [this message]
2011-01-03 19:52 ` [PATCH] ihex: fix unused return value compiler warning Andrew Morton
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1293996430-12598-1-git-send-email-cmruffin@gmail.com \
--to=cmruffin@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=broonie@opensource.wolfsonmicro.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox