Skip to content

Commit

Permalink
posix1e: Don't #include <sys/capability.h> on FreeBSD
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tavianator committed Jan 3, 2019
1 parent 89802c0 commit 6510e8a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 7 deletions.
1 change: 1 addition & 0 deletions parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions posix1e.h
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
7 changes: 0 additions & 7 deletions util.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 6510e8a

Please sign in to comment.