diff options
Diffstat (limited to 'archivers/libarchive/files/examples/untar.c')
-rw-r--r-- | archivers/libarchive/files/examples/untar.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/archivers/libarchive/files/examples/untar.c b/archivers/libarchive/files/examples/untar.c index e77adf70125..dab75d2ede5 100644 --- a/archivers/libarchive/files/examples/untar.c +++ b/archivers/libarchive/files/examples/untar.c @@ -53,7 +53,6 @@ */ #include <sys/types.h> -__FBSDID("$FreeBSD$"); #include <sys/stat.h> @@ -158,8 +157,8 @@ extract(const char *filename, int do_extract, int flags) */ if (filename != NULL && strcmp(filename, "-") == 0) filename = NULL; - if ((r = archive_read_open_file(a, filename, 10240))) - fail("archive_read_open_file()", + if ((r = archive_read_open_filename(a, filename, 10240))) + fail("archive_read_open_filename()", archive_error_string(a), r); for (;;) { r = archive_read_next_header(a, &entry); @@ -190,7 +189,10 @@ extract(const char *filename, int do_extract, int flags) msg("\n"); } archive_read_close(a); - archive_read_finish(a); + archive_read_free(a); + + archive_write_close(ext); + archive_write_free(ext); exit(0); } @@ -200,7 +202,11 @@ copy_data(struct archive *ar, struct archive *aw) int r; const void *buff; size_t size; +#if ARCHIVE_VERSION_NUMBER >= 3000000 + int64_t offset; +#else off_t offset; +#endif for (;;) { r = archive_read_data_block(ar, &buff, &size, &offset); |