Author: mkarcher Date: 2010-01-27 11:08:33 +0100 (Wed, 27 Jan 2010) New Revision: 884
Modified: trunk/dmi.c Log: 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. Signed-off-by: Michael Karcher <[email protected]> Acked-by: Andrew Morgan <[email protected]> Modified: trunk/dmi.c =================================================================== --- trunk/dmi.c 2010-01-26 20:58:40 UTC (rev 883) +++ trunk/dmi.c 2010-01-27 10:08:33 UTC (rev 884) @@ -79,8 +79,8 @@ 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); _______________________________________________ flashrom mailing list [email protected] http://www.flashrom.org/mailman/listinfo/flashrom
