Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1739c26d authored by Quentin Monnet's avatar Quentin Monnet Committed by David S. Miller
Browse files

tools: bpftool: fix return value when all eBPF programs have been shown



Change the program to have a more consistent return code. Specifically,
do not make bpftool return an error code simply because it reaches the
end of the list of the eBPF programs to show.

Signed-off-by: default avatarQuentin Monnet <quentin.monnet@netronome.com>
Signed-off-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 9cbe1f58
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -275,8 +275,10 @@ static int do_show(int argc, char **argv)
	while (true) {
		err = bpf_prog_get_next_id(id, &id);
		if (err) {
			if (errno == ENOENT)
			if (errno == ENOENT) {
				err = 0;
				break;
			}
			err("can't get next program: %s\n", strerror(errno));
			if (errno == EINVAL)
				err("kernel too old?\n");