public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Fritz <chf.fritz@googlemail.com>
To: kernel-janitors@vger.kernel.org
Subject: [PATCH] mkpiggy.c fixes compiler warning
Date: Sun, 14 Mar 2010 18:28:28 +0000	[thread overview]
Message-ID: <1268591308.6104.6.camel@lovely> (raw)

fixes compiler warning (ignoring return value of 'fread', declared with
attribute warn_unused_result) and fseek error returns now


Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com>
---
 arch/x86/boot/compressed/mkpiggy.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/arch/x86/boot/compressed/mkpiggy.c b/arch/x86/boot/compressed/mkpiggy.c
index bcbd36c..78d14d2 100644
--- a/arch/x86/boot/compressed/mkpiggy.c
+++ b/arch/x86/boot/compressed/mkpiggy.c
@@ -61,8 +61,12 @@ int main(int argc, char *argv[])
 
 	if (fseek(f, -4L, SEEK_END)) {
 		perror(argv[1]);
+		return 1;
+	}
+	if (fread(&olen, sizeof olen, 1, f) != 1) {
+		perror(argv[1]);
+		return 1;
 	}
-	fread(&olen, sizeof olen, 1, f);
 	ilen = ftell(f);
 	olen = getle32(&olen);
 	fclose(f);
-- 
1.5.6.5




             reply	other threads:[~2010-03-14 18:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-14 18:28 Christoph Fritz [this message]
2010-03-26 11:17 ` [PATCH] mkpiggy.c fixes compiler warning Henrik Kretzschmar

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=1268591308.6104.6.camel@lovely \
    --to=chf.fritz@googlemail.com \
    --cc=kernel-janitors@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