bpftool: Be more portable by using POSIX's basename()
authorArnaldo Carvalho de Melo <acme@kernel.org>
Mon, 29 Jan 2024 14:33:26 +0000 (11:33 -0300)
committerDaniel Borkmann <daniel@iogearbox.net>
Mon, 29 Jan 2024 15:08:46 +0000 (16:08 +0100)
commit29788f39a4171dd48a6d19eb78cf2ab168c4349a
treed072aec607a6d5fa0825e542e00f11a9e9fdef95
parent723de3ebef03bc14bd72531f00f9094337654009
bpftool: Be more portable by using POSIX's basename()

musl libc had the basename() prototype in string.h, but this is a
glibc-ism, now they removed the _GNU_SOURCE bits in their devel distro,
Alpine Linux edge:

  https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7

So lets use the POSIX version, the whole rationale is spelled out at:

  https://gitlab.alpinelinux.org/alpine/aports/-/issues/15643

Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Jiri Olsa <olsajiri@gmail.com>
Acked-by: Quentin Monnet <quentin@isovalent.com>
Link: https://lore.kernel.org/lkml/ZZhsPs00TI75RdAr@kernel.org
Link: https://lore.kernel.org/bpf/Zbe3NuOgaupvUcpF@kernel.org
tools/bpf/bpftool/gen.c