Skip to content

Commit bb3af56

Browse files
committed
Make options --dump-bin and --quiet work together.
1 parent c641f2c commit bb3af56

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

dmidecode.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -3818,7 +3818,8 @@ static void dmi_table_dump(u32 base, u16 len, const char *devmem)
38183818
return;
38193819
}
38203820

3821-
printf("# Writing %d bytes to %s.\n", len, opt.dumpfile);
3821+
if (!(opt.flags & FLAG_QUIET))
3822+
printf("# Writing %d bytes to %s.\n", len, opt.dumpfile);
38223823
write_dump(32, len, buf, opt.dumpfile, 0);
38233824
free(buf);
38243825
}
@@ -3984,7 +3985,9 @@ static int smbios_decode(u8 *buf, const char *devmem)
39843985
memcpy(crafted, buf, 32);
39853986
overwrite_dmi_address(crafted + 0x10);
39863987

3987-
printf("# Writing %d bytes to %s.\n", crafted[0x05], opt.dumpfile);
3988+
if (!(opt.flags & FLAG_QUIET))
3989+
printf("# Writing %d bytes to %s.\n", crafted[0x05],
3990+
opt.dumpfile);
39883991
write_dump(0, crafted[0x05], crafted, opt.dumpfile, 1);
39893992
}
39903993

dmiopt.c

-2
Original file line numberDiff line numberDiff line change
@@ -287,8 +287,6 @@ int parse_command_line(int argc, char * const argv[])
287287
fprintf(stderr, "Options --string, --type and --dump-bin are mutually exclusive\n");
288288
return -1;
289289
}
290-
if (opt.flags & FLAG_DUMP_BIN)
291-
opt.flags &= ~FLAG_QUIET;
292290

293291
if ((opt.flags & FLAG_FROM_DUMP) && (opt.flags & FLAG_DUMP_BIN))
294292
{

0 commit comments

Comments
 (0)