mirror of
https://github.com/adulau/aha.git
synced 2024-12-26 18:56:14 +00:00
gen_init_cpio: fixed fwrite warning
On compilers with security warnings enabled by default, we get: usr/gen_init_cpio.c: In function ‘cpio_mkfile’: usr/gen_init_cpio.c:357: warning: ignoring return value of ‘fwrite’, declared with attribute warn_unused_result So check the return value and handle errors accordingly. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Signed-off-by: Michal Marek <mmarek@suse.cz>
This commit is contained in:
parent
d9bdcc72ec
commit
6d87fea4dd
1 changed files with 4 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue