On 08/01/2011 06:19 AM, Stefan Hajnoczi wrote:
On Mon, Aug 1, 2011 at 7:49 AM, David Gibson
<da...@gibson.dropbear.id.au> wrote:
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.
Signed-off-by: David Gibson<da...@gibson.dropbear.id.au>
---
hw/fw_cfg.c | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
Reviewed-by: Stefan Hajnoczi<stefa...@linux.vnet.ibm.com>
Tested-by: Stefan Berger <stef...@linux.vnet.ibm.com>