]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Set UF_COMPRESSED flag before write Resource Frok.
authorMichihiro NAKAJIMA <ggcueroad@gmail.com>
Fri, 26 Oct 2012 06:10:45 +0000 (15:10 +0900)
committerMichihiro NAKAJIMA <ggcueroad@gmail.com>
Fri, 26 Oct 2012 06:10:45 +0000 (15:10 +0900)
libarchive/archive_write_disk_posix.c

index b22a74ae51725eb9af4cdbe87d4216a0791adf16..6f2ae015752fb33567872a4567772a0b72d01830 100644 (file)
@@ -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);