]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Restore errno return for functions that were already returning it
authorToke Høiland-Jørgensen <toke@redhat.com>
Tue, 6 Jul 2021 12:23:55 +0000 (14:23 +0200)
committerAndrii Nakryiko <andrii@kernel.org>
Wed, 7 Jul 2021 04:13:08 +0000 (21:13 -0700)
commitda9d51e39a3b22298f7aa5cc629dcbc7a7d9dc6d
tree49d9c7891fd3e14e3b44253e5aa247cdf8531849
parent925932dba58f00f44ea8a814650073740bff3828
libbpf: Restore errno return for functions that were already returning it

The update to streamline libbpf error reporting intended to change all
functions to return the errno as a negative return value if
LIBBPF_STRICT_DIRECT_ERRS is set. However, if the flag is *not* set, the
return value changes for the two functions that were already returning a
negative errno unconditionally: bpf_link__unpin() and perf_buffer__poll().

This is a user-visible API change that breaks applications; so let's revert
these two functions back to unconditionally returning a negative errno
value.

Fixes: 1bd8a3cd33f4 ("libbpf: Streamline error reporting for high-level APIs")
Signed-off-by: Toke Høiland-Jørgensen <toke@redhat.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/bpf/20210706122355.236082-1-toke@redhat.com
tools/lib/bpf/libbpf.c