aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-03-19 01:54:41 +0100
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-03-19 01:54:41 +0100
commit8bb96d322bd08fc0890602494b8a1c417200b20b (patch)
tree4d0e1fa5953dee697d43d5a798ac711dfc125038
parent78ff3072127e6e9b0b3cde5c9618790b24d4c05c (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>
-rw-r--r--mkfs/mkfs.h8
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