From af4ee31898a1d09849dc75f505d5e221b8ab5bb4 Mon Sep 17 00:00:00 2001 From: Michihiro NAKAJIMA Date: Fri, 26 Oct 2012 15:10:45 +0900 Subject: [PATCH] Set UF_COMPRESSED flag before write Resource Frok. --- libarchive/archive_write_disk_posix.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c index b22a74ae5..6f2ae0157 100644 --- a/libarchive/archive_write_disk_posix.c +++ b/libarchive/archive_write_disk_posix.c @@ -1206,6 +1206,14 @@ fprintf(stderr, "\nblock count = %u, file size = %u\n", a->decmpfs_block_count, /* * Set up a resource fork. */ + if ((ret = lazy_stat(a)) != ARCHIVE_OK) + return (ret); + if (fchflags(a->fd, a->st.st_flags | UF_COMPRESSED) != 0) { + archive_set_error(&a->archive, errno, + "failed fchflags for decmpfs"); + return (ARCHIVE_FAILED); + } + /* If the resource fork exists, remove it since we cannot * truncate and we may use decmpfs xattr only. */ ret = hfs_check_resource_fork_existing(a); -- 2.47.2