From: Tim Kientzle Date: Thu, 19 Jun 2008 22:25:03 +0000 (-0400) Subject: Deal with cross-device links by falling back and just copying X-Git-Tag: v2.6.0~160 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1616af95c4a6023decf288249a52ee78d1669a9e;p=thirdparty%2Flibarchive.git Deal with cross-device links by falling back and just copying the file. SVN-Revision: 132 --- diff --git a/cpio/cpio.c b/cpio/cpio.c index 715fb953d..3788611ca 100644 --- a/cpio/cpio.c +++ b/cpio/cpio.c @@ -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); }