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: bf598a8f0f ("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>
This commit is contained in:
Benjamin Poirier 2019-04-11 17:03:32 +09:00 committed by Alexei Starovoitov
parent 7f0c57fec8
commit 77d764263d
1 changed files with 1 additions and 1 deletions

View File

@ -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)