Skip to content

Commit c641f2c

Browse files
committed
Option --dump is only a modifier as --quiet is, so it's not actually
mutually exclusive with the output format options.
1 parent 0ddfb04 commit c641f2c

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

dmidecode.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -3887,7 +3887,8 @@ static void dmi_table(u32 base, u16 len, u16 num, u16 ver, const char *devmem)
38873887
if ((opt.flags & FLAG_QUIET) && h.type == 127)
38883888
break;
38893889

3890-
if (display && !(opt.flags & FLAG_QUIET))
3890+
if (display
3891+
&& (!(opt.flags & FLAG_QUIET) || (opt.flags & FLAG_DUMP)))
38913892
printf("Handle 0x%04X, DMI type %d, %d bytes\n",
38923893
h.handle, h.type, h.length);
38933894

dmiopt.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,12 @@ int parse_command_line(int argc, char * const argv[])
282282

283283
/* Check for mutually exclusive output format options */
284284
if ((opt.string != NULL) + (opt.type != NULL)
285-
+ !!(opt.flags & FLAG_DUMP) + !!(opt.flags & FLAG_DUMP_BIN) > 1)
285+
+ !!(opt.flags & FLAG_DUMP_BIN) > 1)
286286
{
287-
fprintf(stderr, "Options --string, --type, --dump and --dump-bin are mutually exclusive\n");
287+
fprintf(stderr, "Options --string, --type and --dump-bin are mutually exclusive\n");
288288
return -1;
289289
}
290-
if (opt.flags & (FLAG_DUMP | FLAG_DUMP_BIN))
290+
if (opt.flags & FLAG_DUMP_BIN)
291291
opt.flags &= ~FLAG_QUIET;
292292

293293
if ((opt.flags & FLAG_FROM_DUMP) && (opt.flags & FLAG_DUMP_BIN))

man/dmidecode.8

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ Display usage information and exit
125125
.BR "-V" ", " "--version"
126126
Display the version and exit
127127
.P
128-
Options --string, --type, --dump and --dump-bin
128+
Options --string, --type and --dump-bin
129129
determine the output format and are mutually exclusive.
130130

131131
.SH "DMI TYPES"

0 commit comments

Comments
 (0)