]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: use negative fd to specify missing BTF
authorAndrii Nakryiko <andriin@fb.com>
Wed, 29 May 2019 17:36:08 +0000 (10:36 -0700)
committerDaniel Borkmann <daniel@iogearbox.net>
Wed, 29 May 2019 23:23:35 +0000 (01:23 +0200)
commit126ee5dc7377972a17d19cc6f1359a9dbefc964e
tree359d69754de209de08203f3f709d8a0a88528c56
parentd5dc8ea3045120b9ba54871251a37845527aed48
libbpf: use negative fd to specify missing BTF

0 is a valid FD, so it's better to initialize it to -1, as is done in
other places. Also, technically, BTF type ID 0 is valid (it's a VOID
type), so it's more reliable to check btf_fd, instead of
btf_key_type_id, to determine if there is any BTF associated with a map.

Acked-by: Song Liu <songliubraving@fb.com>
Signed-off-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
tools/lib/bpf/libbpf.c