]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Deal with cross-device links by falling back and just copying
authorTim Kientzle <kientzle@gmail.com>
Thu, 19 Jun 2008 22:25:03 +0000 (18:25 -0400)
committerTim Kientzle <kientzle@gmail.com>
Thu, 19 Jun 2008 22:25:03 +0000 (18:25 -0400)
the file.

SVN-Revision: 132

cpio/cpio.c

index 715fb953db937c0a6c47fe3f81264fe439e39920..3788611ca88fc4b5b544130b2f12eb2645fc7ead 100644 (file)
@@ -545,6 +545,12 @@ entry_to_archive(struct cpio *cpio, struct archive_entry *entry)
                            archive_error_string(cpio->archive));
                if (r == ARCHIVE_FATAL)
                        exit(1);
+#ifdef EXDEV
+               if (r != ARCHIVE_OK && archive_errno(cpio->archive) == EXDEV) {
+                       cpio_warnc(0, "Copying file instead");
+                       archive_entry_set_hardlink(entry, NULL);
+               } else
+#endif
                return (0);
        }