summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2008-01-18 04:53:45 +0000
committerkientzle <kientzle@FreeBSD.org>2008-01-18 04:53:45 +0000
commit979a8f34d1fa93558f6c0947d03bb8cdaeada7b5 (patch)
tree83b5a2d2e6237af1f9b8abc0fae76c58c2de4ce6 /lib
parent9acb5351abe07dbff4cfcc2f418a04907be8c402 (diff)
downloadFreeBSD-src-979a8f34d1fa93558f6c0947d03bb8cdaeada7b5.zip
FreeBSD-src-979a8f34d1fa93558f6c0947d03bb8cdaeada7b5.tar.gz
Reconnect the progress callback. It may not get called
as often as you might expect, but at least it will get called now. Thanks to: David Topham for asking how this got disconnected.
Diffstat (limited to 'lib')
-rw-r--r--lib/libarchive/archive_read_extract.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/libarchive/archive_read_extract.c b/lib/libarchive/archive_read_extract.c
index c69c34f..5eb0d36 100644
--- a/lib/libarchive/archive_read_extract.c
+++ b/lib/libarchive/archive_read_extract.c
@@ -67,6 +67,7 @@ get_extract(struct archive_read *a)
archive_set_error(&a->archive, ENOMEM, "Can't extract");
return (NULL);
}
+ memset(a->extract, 0, sizeof(*a->extract));
a->extract->ad = archive_write_disk_new();
if (a->extract->ad == NULL) {
archive_set_error(&a->archive, ENOMEM, "Can't extract");
@@ -130,11 +131,13 @@ archive_read_extract_set_progress_callback(struct archive *_a,
static int
copy_data(struct archive *ar, struct archive *aw)
{
- int r;
+ off_t offset;
const void *buff;
+ struct extract *extract;
size_t size;
- off_t offset;
+ int r;
+ extract = get_extract((struct archive_read *)ar);
for (;;) {
r = archive_read_data_block(ar, &buff, &size, &offset);
if (r == ARCHIVE_EOF)
@@ -149,6 +152,9 @@ copy_data(struct archive *ar, struct archive *aw)
"%s", archive_error_string(aw));
return (r);
}
+ if (extract->extract_progress)
+ (extract->extract_progress)
+ (extract->extract_progress_user_data);
}
}
OpenPOWER on IntegriCloud