diff options
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
-rw-r--r-- | tools/bpf/bpftool/prog.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/tools/bpf/bpftool/prog.c b/tools/bpf/bpftool/prog.c index 41bd5390b4fc..e07f35ff80d1 100644 --- a/tools/bpf/bpftool/prog.c +++ b/tools/bpf/bpftool/prog.c | |||
@@ -602,11 +602,21 @@ err_free: | |||
602 | 602 | ||
603 | static int do_pin(int argc, char **argv) | 603 | static int do_pin(int argc, char **argv) |
604 | { | 604 | { |
605 | return do_pin_any(argc, argv, bpf_prog_get_fd_by_id); | 605 | int err; |
606 | |||
607 | err = do_pin_any(argc, argv, bpf_prog_get_fd_by_id); | ||
608 | if (!err && json_output) | ||
609 | jsonw_null(json_wtr); | ||
610 | return err; | ||
606 | } | 611 | } |
607 | 612 | ||
608 | static int do_help(int argc, char **argv) | 613 | static int do_help(int argc, char **argv) |
609 | { | 614 | { |
615 | if (json_output) { | ||
616 | jsonw_null(json_wtr); | ||
617 | return 0; | ||
618 | } | ||
619 | |||
610 | fprintf(stderr, | 620 | fprintf(stderr, |
611 | "Usage: %s %s show [PROG]\n" | 621 | "Usage: %s %s show [PROG]\n" |
612 | " %s %s dump xlated PROG [{ file FILE | opcodes }]\n" | 622 | " %s %s dump xlated PROG [{ file FILE | opcodes }]\n" |