* src/xattr.h: Fix #define fsetxattr for MacOS and FreeBSD

Reported-by: Zhiming Wang
This commit is contained in:
Tim Rühsen 2017-02-04 15:29:44 +01:00
parent 58546e52e2
commit f2c4289557

View File

@ -30,14 +30,14 @@ int set_file_metadata (const char *origin_url, const char *referrer_url, FILE *f
#elif defined(__APPLE__)
/* libc on OS/X has fsetxattr (6 arguments). */
# include <sys/xattr.h>
# define fsetxattr (file, name, buffer, size, flags) \
# define fsetxattr(file, name, buffer, size, flags) \
fsetxattr ((file), (name), (buffer), (size), 0, (flags))
# define USE_XATTR
#elif defined(__FreeBSD_version) && (__FreeBSD_version > 500000)
/* FreeBSD */
# include <sys/types.h>
# include <sys/extattr.h>
# define fsetxattr (file, name, buffer, size, flags) \
# define fsetxattr(file, name, buffer, size, flags) \
extattr_set_fd ((file), EXTATTR_NAMESPACE_USER, (name), (buffer), (size))
# define USE_XATTR
#endif