Skip to content

Commit

Permalink
bpftool: Fix errno variable usage
Browse files Browse the repository at this point in the history
The test meant to use the saved value of errno. Given the current code, it
makes no practical difference however.

Fixes: bf598a8 ("bpftool: Improve handling of ENOENT on map dumps")
Signed-off-by: Benjamin Poirier <bpoirier@suse.com>
Reviewed-by: Quentin Monnet <quentin.monnet@netronome.com>
Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
  • Loading branch information
Benjamin Poirier authored and Alexei Starovoitov committed Apr 26, 2019
1 parent 7f0c57f commit 77d7642
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/bpf/bpftool/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ static int dump_map_elem(int fd, void *key, void *value,
} else {
const char *msg = NULL;

if (errno == ENOENT)
if (lookup_errno == ENOENT)
msg = "<no entry>";
else if (lookup_errno == ENOSPC &&
map_info->type == BPF_MAP_TYPE_REUSEPORT_SOCKARRAY)
Expand Down

0 comments on commit 77d7642

Please sign in to comment.