public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mkpiggy.c fixes compiler warning
@ 2010-03-14 18:28 Christoph Fritz
  2010-03-26 11:17 ` Henrik Kretzschmar
  0 siblings, 1 reply; 2+ messages in thread
From: Christoph Fritz @ 2010-03-14 18:28 UTC (permalink / raw)
  To: kernel-janitors

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




^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-03-26 11:17 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-14 18:28 [PATCH] mkpiggy.c fixes compiler warning Christoph Fritz
2010-03-26 11:17 ` Henrik Kretzschmar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox