Skip to content
Commit 07453245 authored by Xin Liu's avatar Xin Liu Committed by Alexei Starovoitov
Browse files

libbpf: fix errno is overwritten after being closed.



In the ensure_good_fd function, if the fcntl function succeeds but
the close function fails, ensure_good_fd returns a normal fd and
sets errno, which may cause users to misunderstand. The close
failure is not a serious problem, and the correct FD has been
handed over to the upper-layer application. Let's restore errno here.

Signed-off-by: default avatarXin Liu <liuxin350@huawei.com>
Link: https://lore.kernel.org/r/20221223133618.10323-1-liuxin350@huawei.com


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 4633a006
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment