« Previous | Next » 

Revision 257a7375

ID257a7375582e4c3b32687c72d0f52279d28b2d85

Added by David Gibson over 12 years ago

Check fread() results to avoid gcc 4.6 warnings

When compiling with gcc 4.6, some code in fw_cfg.c complains that fop_ret
is assigned but not used (which is true). However, it looks like the
meaningless assignments to fop_ret were done to suppress other gcc warnings
due to the fact that fread() is labelled as warn_unused_result in glibc.

This patch avoids both errors, by actually checking the fread() result code
and dropping out with an error message if it fails.

Reviewed-by: Stefan Hajnoczi <>
Tested-by: Stefan Berger <>
Signed-off-by: David Gibson <>
Signed-off-by: Anthony Liguori <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences