summaryrefslogtreecommitdiffstats
path: root/dmi.c
diff options
context:
space:
mode:
authorMichael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>2010-01-27 10:08:33 +0000
committerMichael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>2010-01-27 10:08:33 +0000
commit823dc9d9bc1e9aa9e695a9765a8ae54862b913ee (patch)
tree71f985875cbbd6a0cfcc676894b7edcf39e23102 /dmi.c
parent06602c239c5de952bdc384a7f41d106ed6d24dc2 (diff)
downloadast2050-flashrom-823dc9d9bc1e9aa9e695a9765a8ae54862b913ee.zip
ast2050-flashrom-823dc9d9bc1e9aa9e695a9765a8ae54862b913ee.tar.gz
Avoid bogus gcc warning
Recent gcc/glibc combinations warn about ignoring the fgets() result. The problem exists on Ubuntu 9.10 with current updates. This "fix" of the non-problem (as I check ferror() afterwards) should even be a (negligible) performance optimization. Corresponding to flashrom svn r884. Signed-off-by: Michael Karcher <flashrom@mkarcher.dialup.fu-berlin.de> Acked-by: Andrew Morgan <ziltro@ziltro.com>
Diffstat (limited to 'dmi.c')
-rw-r--r--dmi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/dmi.c b/dmi.c
index ca75461..d165e9f 100644
--- a/dmi.c
+++ b/dmi.c
@@ -79,8 +79,8 @@ void dmi_init(void)
printf_debug("DMI pipe open error\n");
goto out_free;
}
- fgets(answerbuf, DMI_MAX_ANSWER_LEN, dmidecode_pipe);
- if (ferror(dmidecode_pipe))
+ if (!fgets(answerbuf, DMI_MAX_ANSWER_LEN, dmidecode_pipe) &&
+ ferror(dmidecode_pipe))
{
printf_debug("DMI pipe read error\n");
pclose(dmidecode_pipe);
OpenPOWER on IntegriCloud