Thread (7 messages) 7 messages, 3 authors, 2020-07-22

Re: [PATCH bpf-next v4] bpftool: use only nftw for file tree parsing

flat view

From: Tony Ambardar <hidden>
Date: 2020-07-22 00:20:39
Also in: bpf

On Tue, 21 Jul 2020 at 14:50, Daniel Borkmann [off-list ref] wrote:
On 7/21/20 4:48 AM, Tony Ambardar wrote:
quoted
The bpftool sources include code to walk file trees, but use multiple
frameworks to do so: nftw and fts. While nftw conforms to POSIX/SUSv3 and
is widely available, fts is not conformant and less common, especially on
non-glibc systems. The inconsistent framework usage hampers maintenance
and portability of bpftool, in particular for embedded systems.

Standardize code usage by rewriting one fts-based function to use nftw and
clean up some related function warnings by extending use of "const char *"
arguments. This change helps in building bpftool against musl for OpenWrt.

Also fix an unsafe call to dirname() by duplicating the string to pass,
since some implementations may directly alter it. The same approach is
used in libbpf.c.

Signed-off-by: Tony Ambardar <redacted>
Lgtm, applied, thanks!
Thank you, and much appreciation to Quentin for helpful review and feedback.

Best regards,
Tony
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help