diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2019-01-03 17:19:25 -0500 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2019-01-03 17:19:25 -0500 |
commit | 6510e8af463a43ef686f17968e87f9c4b5cc868f (patch) | |
tree | 8fe75f5c3758f3b71893707a6b71e28915eca580 | |
parent | 89802c00cffe574a2e461ba0d9b29db572102e43 (diff) | |
download | bfs-6510e8af463a43ef686f17968e87f9c4b5cc868f.tar.xz |
posix1e: Don't #include <sys/capability.h> on FreeBSD
The file is there by default, but deprecated and not a POSIX.1E
implementation. While I'm at it, move the logic to posix1e.h so other
files aren't burdened with an extra include.
Fixes the other half of #40.
-rw-r--r-- | parse.c | 1 | ||||
-rw-r--r-- | posix1e.h | 8 | ||||
-rw-r--r-- | util.h | 7 |
3 files changed, 9 insertions, 7 deletions
@@ -22,6 +22,7 @@ #include "exec.h" #include "expr.h" #include "mtab.h" +#include "posix1e.h" #include "printf.h" #include "stat.h" #include "typo.h" @@ -19,6 +19,14 @@ #include "bftw.h" #include "util.h" +#include <stdbool.h> + +#if BFS_HAS_SYS_CAPABILITY && !__FreeBSD__ +# include <sys/capability.h> +# ifdef CAP_CHOWN +# define BFS_HAS_POSIX1E_CAPABILITIES true +# endif +#endif /** * Check if a file has a non-trvial Access Control List. @@ -40,13 +40,6 @@ #define BFS_HAS_SYS_PARAM BFS_HAS_INCLUDE(<sys/param.h>, true) #define BFS_HAS_SYS_SYSMACROS BFS_HAS_INCLUDE(<sys/sysmacros.h>, __GLIBC__) -#if BFS_HAS_SYS_CAPABILITY -# include <sys/capability.h> -# ifdef CAP_CHOWN -# define BFS_HAS_POSIX1E_CAPABILITIES true -# endif -#endif - #if !defined(FNM_CASEFOLD) && defined(FNM_IGNORECASE) # define FNM_CASEFOLD FNM_IGNORECASE #endif |