From b9ec84f06f242bae5d075c9ec573aff9f0bd060b Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Fri, 11 Aug 2023 00:28:02 -0400 Subject: [PATCH] [core] use different getxattr() prototype on MacOS (thx sevan) x-ref: https://github.com/mistydemeo/tigerbrew/pull/917 --- src/stat_cache.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/stat_cache.c b/src/stat_cache.c index 2b31430b8..4d41475cb 100644 --- a/src/stat_cache.c +++ b/src/stat_cache.c @@ -841,8 +841,13 @@ static int stat_cache_attr_get(const char *name) { #if defined(HAVE_XATTR) #if defined(HAVE_SYS_XATTR_H) ssize_t attrlen; + #if defined(__APPLE__) && defined(__MACH__) + if (0 < (attrlen = getxattr(name, attrname, + attrval, sizeof(attrval)-1, 0, 0))) + #else if (0 < (attrlen = getxattr(name, attrname, attrval, sizeof(attrval)-1))) + #endif #else int attrlen = sizeof(attrval)-1; if (0 == attr_get(name, attrname, attrval, &attrlen, 0))