From d459b59ee0f5ed2fa96e77bbd919e095b1aeceb0 Mon Sep 17 00:00:00 2001 From: Prashant Bhole Date: Wed, 17 Apr 2019 09:22:58 +0900 Subject: [PATCH] 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 Reviewed-by: Quentin Monnet Reviewed-by: Jakub Kicinski Acked-by: Song Liu Signed-off-by: Alexei Starovoitov --- tools/bpf/bpftool/map.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c index 44b192e87708..846d2e5c64b4 100644 --- a/tools/bpf/bpftool/map.c +++ b/tools/bpf/bpftool/map.c @@ -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; } -- 2.30.2