Changeset 1136 for trunk/dmi.c
- Timestamp:
- 08/08/10 23:56:52 (22 months ago)
- File:
-
- 1 edited
-
trunk/dmi.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/dmi.c
r1112 r1136 77 77 return NULL; 78 78 } 79 if (!fgets(answerbuf, DMI_MAX_ANSWER_LEN, dmidecode_pipe)) { 80 if(ferror(dmidecode_pipe)) { 81 msg_perr("DMI pipe read error\n"); 82 pclose(dmidecode_pipe); 83 return NULL; 84 } else { 85 answerbuf[0] = 0; /* Hit EOF */ 79 80 /* Kill lines starting with '#', as recent dmidecode versions 81 have the quirk to emit a "# SMBIOS implementations newer..." 82 message even on "-s" if the SMBIOS declares a 83 newer-than-supported version number, while it *should* only print 84 the requested string. */ 85 do { 86 if (!fgets(answerbuf, DMI_MAX_ANSWER_LEN, dmidecode_pipe)) { 87 if(ferror(dmidecode_pipe)) { 88 msg_perr("DMI pipe read error\n"); 89 pclose(dmidecode_pipe); 90 return NULL; 91 } else { 92 answerbuf[0] = 0; /* Hit EOF */ 93 } 86 94 } 87 } 95 } while(answerbuf[0] == '#'); 96 88 97 /* Toss all output above DMI_MAX_ANSWER_LEN away to prevent 89 98 deadlock on pclose. */
Note: See TracChangeset
for help on using the changeset viewer.
