aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPrashant Bhole <[email protected]>2019-04-17 09:22:58 +0900
committerAlexei Starovoitov <[email protected]>2019-04-16 19:48:26 -0700
commitd459b59ee0f5ed2fa96e77bbd919e095b1aeceb0 (patch)
treebe1732953aae694f66ac96c2d626e99822bfaba2
parentf25377ee4fb1118650a08b403234aa6f57ce25a9 (diff)
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 <[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]>
-rw-r--r--tools/bpf/bpftool/map.c5
1 files 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;
}