return (start_size - size);
}
-#if defined(__APPLE__) && defined(UF_COMPRESSED)
+#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)
/*
* Set UF_COMPRESSED file flag.
* apply it to the target file.
*/
+#if defined(HAVE_SYS_XATTR_H)
static int
copy_xattrs(struct archive_write_disk *a, int tmpfd, int dffd)
{
free(xattr_val);
return (ret);
}
+#endif
static int
copy_acls(struct archive_write_disk *a, int tmpfd, int dffd)
return (ARCHIVE_WARN);
}
+#if defined(HAVE_SYS_XATTR_H)
ret = copy_xattrs(a, tmpfd, dffd);
if (ret == ARCHIVE_OK)
+#endif
ret = copy_acls(a, tmpfd, dffd);
close(tmpfd);
close(dffd);
} else {
int compressed;
+#if defined(UF_COMPRESSED)
if ((a->todo & TODO_HFS_COMPRESSION) != 0 &&
(ret = lazy_stat(a)) == ARCHIVE_OK)
compressed = a->st.st_flags & UF_COMPRESSED;
else
+#endif
compressed = 0;
ret = copy_metadata(a, tmp.s, pathname, compressed);
}
goto skip_appledouble;
ret = copy_metadata(a, pathname, datafork.s,
+#if defined(UF_COMPRESSED)
st.st_flags & UF_COMPRESSED);
+#else
+ 0);
+#endif
if (ret == ARCHIVE_OK) {
unlink(pathname);
ret = ARCHIVE_EOF;
#include <sys/xattr.h>
#endif
-#if defined(__APPLE__) && defined(UF_COMPRESSED)
+#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)
static int
has_xattr(const char *filename, const char *xattrname)
{
*/
DEFINE_TEST(test_write_disk_appledouble)
{
-#if !defined(__APPLE__) || !defined(UF_COMPRESSED)
+#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)
skipping("MacOS-specific AppleDouble test");
#else
const char *refname = "test_write_disk_appledouble.cpio.gz";
#include <sys/xattr.h>
#endif
-#if defined(__APPLE__) && defined(UF_COMPRESSED)
+#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)
static int
has_xattr(const char *filename, const char *xattrname)
{
*/
DEFINE_TEST(test_write_disk_hfs_compression)
{
-#if !defined(__APPLE__) || !defined(UF_COMPRESSED)
+#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)
skipping("MacOS-specific HFS+ Compression test");
#else
const char *refname = "test_write_disk_hfs_compression.tgz";
#include <sys/xattr.h>
#endif
-#if defined(__APPLE__) && defined(UF_COMPRESSED)
+#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)
static int
has_xattr(const char *filename, const char *xattrname)
{
*/
DEFINE_TEST(test_write_disk_mac_metadata)
{
-#if !defined(__APPLE__) || !defined(UF_COMPRESSED)
+#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)
skipping("MacOS-specific Mac Metadata test");
#else
const char *refname = "test_write_disk_mac_metadata.tar.gz";
#include <sys/xattr.h>
#endif
-#if defined(__APPLE__) && defined(UF_COMPRESSED)
+#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)
static int
has_xattr(const char *filename, const char *xattrname)
{
*/
DEFINE_TEST(test_write_disk_no_hfs_compression)
{
-#if !defined(__APPLE__) || !defined(UF_COMPRESSED)
+#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)
skipping("MacOS-specific HFS+ Compression test");
#else
const char *refname = "test_write_disk_no_hfs_compression.tgz";