Commit 823dc9d9 authored by Michael Karcher's avatar Michael Karcher
Browse files

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: default avatarMichael Karcher <flashrom@mkarcher.dialup.fu-berlin.de>
Acked-by: default avatarAndrew Morgan <ziltro@ziltro.com>
parent 06602c23
......@@ -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);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment