bpftool: Fix errno variable usage
Subsystems (4)
PATCH 1/1 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.
--- tools/bpf/bpftool/map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/bpf/bpftool/map.c +1 -1
@@ -720,7 +720,7 @@ static int dump_map_elem(int fd, void *key, void *value,jsonw_string_field (json_wtr,"error" ,strerror (lookup_errno));jsonw_end_object (json_wtr); }else { -if (errno ==ENOENT ) +if (lookup_errno ==ENOENT )print_entry_plain (map_info, key,NULL );else print_entry_error(map_info, key,
Signature · 1 line
2.21.0
2019-04-11 17:03 UTC+0900 ~ Benjamin Poirier <[email protected]>
Quoted 15 lines
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 <[email protected]>--- tools/bpf/bpftool/map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/bpf/bpftool/map.c +0
-0
tools/bpf/bpftool/map.c static int dump_map_elem(int fd, void *key, void *value, · line 726
Quoted 8 lines
tools/bpf/bpftool/map.c +1
-1@@ -720,7 +720,7 @@ static int dump_map_elem(int fd, void *key, void *value,jsonw_string_field (json_wtr,"error" ,strerror (lookup_errno));jsonw_end_object (json_wtr); }else { -if (errno ==ENOENT ) +if (lookup_errno ==ENOENT )print_entry_plain (map_info, key,NULL );else print_entry_error(map_info, key,
Song Liu
Acked-byQuoted 7 lines · Quentin Monnet
2019-04-11 17:03 UTC+0900 ~ Benjamin Poirier <[email protected]>
Quoted 5 lines
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 <[email protected]>
Quoted 21 lines
Quoted 10 lines
--- tools/bpf/bpftool/map.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/bpf/bpftool/map.c +0
-0tools/bpf/bpftool/map.c static int dump_map_elem(int fd, void *key, void *value, · line 726
Quoted 8 lines
tools/bpf/bpftool/map.c +1
-1@@ -720,7 +720,7 @@ static int dump_map_elem(int fd, void *key, void *value,jsonw_string_field (json_wtr,"error" ,strerror (lookup_errno));jsonw_end_object (json_wtr); }else { -if (errno ==ENOENT ) +if (lookup_errno ==ENOENT )print_entry_plain (map_info, key,NULL );else print_entry_error(map_info, key,Reviewed-by Quentin Monnet <[email protected]>
Quoted 5 lines · Benjamin Poirier
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 <[email protected]>
Applied, thanks!
Quoted 9 lines · Daniel Borkmann
Quoted 5 lines · Benjamin Poirier
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 <[email protected]>Applied, thanks!
I removed this commit from bpf tree and re-applied to bpf-next. Benjamin, next time please target such cleanups consistently to bpf-next tree only to avoid merge conflicts.
Thanks