From: Michihiro NAKAJIMA Date: Fri, 26 Oct 2012 06:10:45 +0000 (+0900) Subject: Set UF_COMPRESSED flag before write Resource Frok. X-Git-Tag: v3.1.0~40^2~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=af4ee31898a1d09849dc75f505d5e221b8ab5bb4;p=thirdparty%2Flibarchive.git Set UF_COMPRESSED flag before write Resource Frok. --- 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);