From e5283c726fc9cacd0741d6453022491d14929a6a Mon Sep 17 00:00:00 2001 From: Michihiro NAKAJIMA Date: Fri, 2 Nov 2012 05:29:20 +0900 Subject: [PATCH] Change compiling conditions for support for HFS+ Compression since it is only for MacOS X. --- libarchive/archive_write_disk_posix.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c index 8cb27f5e7..c29df5e4f 100644 --- a/libarchive/archive_write_disk_posix.c +++ b/libarchive/archive_write_disk_posix.c @@ -548,7 +548,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) else a->todo |= TODO_MAC_METADATA; } -#if defined(HAVE_ZLIB_H) && defined(UF_COMPRESSED) +#if defined(__APPLE__) && defined(UF_COMPRESSED) if ((a->flags & ARCHIVE_EXTRACT_NO_HFS_COMPRESSION) == 0) { unsigned long set, clear; archive_entry_fflags(a->entry, &set, &clear); @@ -562,11 +562,9 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) a->todo |= TODO_HFS_COMPRESSION; a->decmpfs_block_count = (unsigned)-1; } -#ifdef __APPLE__ /* Do not compress "._XXX" files. */ if (a->name[0] == '.' && a->name[1] == '_') a->todo &= ~TODO_HFS_COMPRESSION; -#endif #endif if (a->flags & ARCHIVE_EXTRACT_XATTR) @@ -585,7 +583,7 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) ret = restore_entry(a); -#if defined(HAVE_ZLIB_H) && defined(UF_COMPRESSED) +#if defined(__APPLE__) && defined(UF_COMPRESSED) /* * Check if the filesystem the file is restoring on supports * HFS+ Compression. If not, cancel HFS+ Compression. @@ -821,7 +819,7 @@ write_data_block(struct archive_write_disk *a, const char *buff, size_t size) return (start_size - size); } -#if defined(HAVE_ZLIB_H) && defined(UF_COMPRESSED) +#if defined(__APPLE__) && defined(UF_COMPRESSED) /* * Set UF_COMPRESSED file flag. @@ -1427,7 +1425,7 @@ _archive_write_disk_finish_entry(struct archive *_a) } else if (a->fd_offset == a->filesize) { /* Last write ended at exactly the filesize; we're done. */ /* Hopefully, this is the common case. */ -#if defined(HAVE_ZLIB_H) && defined(UF_COMPRESSED) +#if defined(__APPLE__) && defined(UF_COMPRESSED) } else if (a->todo & TODO_HFS_COMPRESSION) { char null_d[1024]; ssize_t r; -- 2.47.2