tavianator / bfs

A breadth-first version of the UNIX find command

Home Page:https://tavianator.com/projects/bfs.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bfs 1.3 fails to build on FreeBSD

t6 opened this issue · comments

Commit b2e69d3 changes some EINVAL to ENODATA which is not defined on FreeBSD. Please advise on what I should replace it with.

Another issue is that util.h now includes sys/capability.h apparently unconditionally even on non-Linux platforms leading to

/usr/include/sys/capability.h:44:2: warning: this file includes <sys/capability.h> which is deprecated [-W#warnings]
#warning this file includes <sys/capability.h> which is deprecated
 ^

On FreeBSD sys/capability.h is an older name for sys/capcisum.h. It's not the same header as on Linux, so the __has_include check is not sufficient.

That's what I get for not reading the POSIX errno.h spec in detail. ENODATA is part of the optional STREAMS extension, so bfs shouldn't rely on it. Probably ENOTSUP is good instead.

About sys/capability.h, it may be worth doing something like

#if BFS_HAS_SYS_CAPABILITY && !__FreeBSD__
#	include <sys/capability.h>
...

and moving that whole block to posix1e.h.

Thanks for resolving so quickly and tagging 1.3.1! I've updated the FreeBSD package.