From 77d764263d1165a2edf13735915fc39bc44abf1d Mon Sep 17 00:00:00 2001 From: Benjamin Poirier Date: Thu, 11 Apr 2019 17:03:32 +0900 Subject: [PATCH] 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: bf598a8f0f77 ("bpftool: Improve handling of ENOENT on map dumps") Signed-off-by: Benjamin Poirier Reviewed-by: Quentin Monnet Acked-by: Song Liu Signed-off-by: Daniel Borkmann Signed-off-by: Alexei Starovoitov --- tools/bpf/bpftool/map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/bpf/bpftool/map.c b/tools/bpf/bpftool/map.c index 10b6c9d3e525..e6dcb3653a77 100644 --- a/tools/bpf/bpftool/map.c +++ b/tools/bpf/bpftool/map.c @@ -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 = ""; else if (lookup_errno == ENOSPC && map_info->type == BPF_MAP_TYPE_REUSEPORT_SOCKARRAY)