diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-03-19 01:54:41 +0100 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2020-03-19 01:54:41 +0100 |
commit | 8bb96d322bd08fc0890602494b8a1c417200b20b (patch) | |
tree | 4d0e1fa5953dee697d43d5a798ac711dfc125038 /mkfs/mkfs.h | |
parent | 78ff3072127e6e9b0b3cde5c9618790b24d4c05c (diff) |
Fix xattr scanning on Mac OS X
Mac OS X does not have llistxattr or lgetxattr. Instead, the listxattr
and getxattr functions have additional an flag parameter that can be
set to not follow symlinks. This commit adds a pre-processor define on
OS X as a work around.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'mkfs/mkfs.h')
-rw-r--r-- | mkfs/mkfs.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/mkfs/mkfs.h b/mkfs/mkfs.h index 21e1715..1b767aa 100644 --- a/mkfs/mkfs.h +++ b/mkfs/mkfs.h @@ -14,6 +14,14 @@ #ifdef HAVE_SYS_XATTR_H #include <sys/xattr.h> + +#if defined(__APPLE__) && defined(__MACH__) +#define llistxattr(path, list, size) \ + listxattr(path, list, size, XATTR_NOFOLLOW) + +#define lgetxattr(path, name, value, size) \ + getxattr(path, name, value, size, 0, XATTR_NOFOLLOW) +#endif #endif #ifdef WITH_SELINUX |