Commit 77d76426 authored by Benjamin Poirier's avatar Benjamin Poirier Committed by Alexei Starovoitov

bpftool: Fix errno variable usage

The test meant to use the saved value of errno. Given the current code, it
makes no practical difference however.

Fixes: bf598a8f ("bpftool: Improve handling of ENOENT on map dumps")
Signed-off-by: default avatarBenjamin Poirier <bpoirier@suse.com>
Reviewed-by: default avatarQuentin Monnet <quentin.monnet@netronome.com>
Acked-by: default avatarSong Liu <songliubraving@fb.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 7f0c57fe
...@@ -724,7 +724,7 @@ static int dump_map_elem(int fd, void *key, void *value, ...@@ -724,7 +724,7 @@ static int dump_map_elem(int fd, void *key, void *value,
} else { } else {
const char *msg = NULL; const char *msg = NULL;
if (errno == ENOENT) if (lookup_errno == ENOENT)
msg = "<no entry>"; msg = "<no entry>";
else if (lookup_errno == ENOSPC && else if (lookup_errno == ENOSPC &&
map_info->type == BPF_MAP_TYPE_REUSEPORT_SOCKARRAY) map_info->type == BPF_MAP_TYPE_REUSEPORT_SOCKARRAY)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment