1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-16 10:20:30 +00:00

As reported by Alexey Shuvaev, -dumpl overwrote files after

linking them, with predictably bad results.
This commit is contained in:
Tim Kientzle 2008-06-26 15:46:01 +00:00
parent f4c1db8901
commit 6986afe53e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=180033

View File

@ -546,6 +546,8 @@ entry_to_archive(struct cpio *cpio, struct archive_entry *entry)
/* Note: link(2) doesn't create parent directories,
* so we use archive_write_header() instead. */
archive_entry_set_hardlink(t, srcpath);
/* This is a straight link that carries no data. */
archive_entry_set_size(t, 0);
r = archive_write_header(cpio->archive, t);
archive_entry_free(t);
if (r != ARCHIVE_OK)