From 1616af95c4a6023decf288249a52ee78d1669a9e Mon Sep 17 00:00:00 2001 From: Tim Kientzle Date: Thu, 19 Jun 2008 18:25:03 -0400 Subject: [PATCH] Deal with cross-device links by falling back and just copying the file. SVN-Revision: 132 --- cpio/cpio.c | 6 ++++++ 1 file changed, 6 insertions(+) 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); } -- 2.47.3