aboutsummaryrefslogtreecommitdiff
path: root/lib/libarchive/archive_write_disk.c
diff options
context:
space:
mode:
authorTim Kientzle <kientzle@FreeBSD.org>2008-09-12 04:08:11 +0000
committerTim Kientzle <kientzle@FreeBSD.org>2008-09-12 04:08:11 +0000
commita2854491c482db3bc37ed98d8f3fdabcb88d1dd7 (patch)
tree8a87de07a054bab4ad94fcb7eb6668f06b8b38dd /lib/libarchive/archive_write_disk.c
parent220265229d196aa96a5fb3df55cf67f59bdab243 (diff)
Notes
Diffstat (limited to 'lib/libarchive/archive_write_disk.c')
-rw-r--r--lib/libarchive/archive_write_disk.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libarchive/archive_write_disk.c b/lib/libarchive/archive_write_disk.c
index f0bec6e9c812..8b364f250505 100644
--- a/lib/libarchive/archive_write_disk.c
+++ b/lib/libarchive/archive_write_disk.c
@@ -637,12 +637,14 @@ _archive_write_finish_entry(struct archive *_a)
/* Last write ended at exactly the filesize; we're done. */
/* Hopefully, this is the common case. */
} else {
+#if HAVE_FTRUNCATE
if (ftruncate(a->fd, a->filesize) == -1 &&
a->filesize == 0) {
archive_set_error(&a->archive, errno,
"File size could not be restored");
return (ARCHIVE_FAILED);
}
+#endif
/*
* Explicitly stat the file as some platforms might not
* implement the XSI option to extend files via ftruncate.