mirror of
https://git.freebsd.org/src.git
synced 2026-01-11 19:57:22 +00:00
genl: fix printing of a command with zero capabilities
This commit is contained in:
parent
753a4acd09
commit
d2e6eb6046
1 changed files with 10 additions and 4 deletions
|
|
@ -214,13 +214,19 @@ dump_operations(struct genl_ctrl_ops *ops)
|
|||
return;
|
||||
printf("\tsupported operations: \n");
|
||||
for (uint32_t i = 0; i < ops->num_ops; i++) {
|
||||
printf("\t - ID: %#02x, Capabilities: %#02x (",
|
||||
bool p = true;
|
||||
|
||||
printf("\t - ID: %#02x, Capabilities: %#02x",
|
||||
ops->ops[i]->id,
|
||||
ops->ops[i]->flags);
|
||||
for (size_t j = 0; j < nitems(op_caps); j++)
|
||||
if ((ops->ops[i]->flags & op_caps[j].flag) == op_caps[j].flag)
|
||||
printf("%s; ", op_caps[j].str);
|
||||
printf("\b\b)\n");
|
||||
if ((ops->ops[i]->flags & op_caps[j].flag) ==
|
||||
op_caps[j].flag) {
|
||||
printf("%s%s", p ? " (" : "; ",
|
||||
op_caps[j].str);
|
||||
p = false;
|
||||
}
|
||||
printf("%s\n", p ? "" : ")");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue