]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Ignore -l for non-regular files. Comment that this is
authorTim Kientzle <kientzle@gmail.com>
Wed, 2 Jul 2008 22:28:34 +0000 (18:28 -0400)
committerTim Kientzle <kientzle@gmail.com>
Wed, 2 Jul 2008 22:28:34 +0000 (18:28 -0400)
still open to negotiation.

SVN-Revision: 147

cpio/cpio.c

index 52a3a73529b09cab2a3e3b348eaf99374bb793da..76a91cf71528b2653328bb45c07d3fa3d2b678bb 100644 (file)
@@ -535,14 +535,16 @@ entry_to_archive(struct cpio *cpio, struct archive_entry *entry)
                fprintf(stderr,"%s", destpath);
 
        /*
-        * Obviously, this only gets invoked in pass mode, since
-        * option_link is nonsense otherwise.  Note that we can't
-        * hardlink dirs, and that if a link operation fails (because
-        * of cross-device restrictions), we'll fall back to copy mode
-        * for that entry.
+        * Option_link only makes sense in pass mode and for
+        * regular files.  Also note: if a link operation fails
+        * because of cross-device restrictions, we'll fall back
+        * to copy mode for that entry.
+        *
+        * TODO: Test other cpio implementations to see if they
+        * hard-link anything other than regular files here.
         */
        if (cpio->option_link
-           && archive_entry_filetype(entry) != AE_IFDIR)
+           && archive_entry_filetype(entry) == AE_IFREG)
        {
                struct archive_entry *t;
                /* Save the original entry in case we need it later. */