Skip to content

Commit

Permalink
tools/bpftool: re-organize newline printing for map listing
Browse files Browse the repository at this point in the history
Let's move the final newline printing in show_map_close_plain() at
the end of the function because it looks correct and consistent with
prog.c. Also let's do related changes for the line which prints
pinned file name.

Signed-off-by: Prashant Bhole <[email protected]>
Reviewed-by: Quentin Monnet <[email protected]>
Reviewed-by: Jakub Kicinski <[email protected]>
Acked-by: Song Liu <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
  • Loading branch information
pbhole authored and Alexei Starovoitov committed Apr 17, 2019
1 parent f25377e commit d459b59
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/bpf/bpftool/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -597,15 +597,16 @@ static int show_map_close_plain(int fd, struct bpf_map_info *info)
}
close(fd);

printf("\n");
if (!hash_empty(map_table.table)) {
struct pinned_obj *obj;

hash_for_each_possible(map_table.table, obj, hash, info->id) {
if (obj->id == info->id)
printf("\tpinned %s\n", obj->path);
printf("\n\tpinned %s", obj->path);
}
}

printf("\n");
return 0;
}

Expand Down

0 comments on commit d459b59

Please sign in to comment.