VisionFive2 Linux kernel

StarFive Tech Linux Kernel for VisionFive (JH7110) boards (mirror)

More than 9999 Commits   33 Branches   55 Tags
author: Mike Frysinger <vapier@gentoo.org> 2009-12-09 06:55:19 -0500 committer: Michal Marek <mmarek@suse.cz> 2009-12-12 13:08:17 +0100 commit: 6d87fea4dd7152df4a4605a3846c3bf10f869e0c parent: d9bdcc72ecf055f97ed736a6c0309bd41baf10a7
Commit Summary:
gen_init_cpio: fixed fwrite warning
Diffstat:
1 file changed, 4 insertions, 1 deletion
diff --git a/usr/gen_init_cpio.c b/usr/gen_init_cpio.c
index 83b3dde1a83b..b2b3c2d1cf8b 100644
--- a/usr/gen_init_cpio.c
+++ b/usr/gen_init_cpio.c
@@ -354,7 +354,10 @@ static int cpio_mkfile(const char *name, const char *location,
 		push_pad();
 
 		if (size) {
-			fwrite(filebuf, size, 1, stdout);
+			if (fwrite(filebuf, size, 1, stdout) != 1) {
+				fprintf(stderr, "writing filebuf failed\n");
+				goto error;
+			}
 			offset += size;
 			push_pad();
 		}