Skip to content

Commit d459b59

Browse files
pbholeAlexei Starovoitov
authored andcommitted
tools/bpftool: re-organize newline printing for map listing
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 <bhole_prashant_q7@lab.ntt.co.jp> Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com> Reviewed-by: Jakub Kicinski <jakub.kicinski@netronome.com> Acked-by: Song Liu <songliubraving@fb.com> Signed-off-by: Alexei Starovoitov <ast@kernel.org>
1 parent f25377e commit d459b59

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎tools/bpf/bpftool/map.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -597,15 +597,16 @@ static int show_map_close_plain(int fd, struct bpf_map_info *info)
597597
}
598598
close(fd);
599599

600-
printf("\n");
601600
if (!hash_empty(map_table.table)) {
602601
struct pinned_obj *obj;
603602

604603
hash_for_each_possible(map_table.table, obj, hash, info->id) {
605604
if (obj->id == info->id)
606-
printf("\tpinned %s\n", obj->path);
605+
printf("\n\tpinned %s", obj->path);
607606
}
608607
}
608+
609+
printf("\n");
609610
return 0;
610611
}
611612

0 commit comments

Comments
 (0)