From af89cb16bfde2fc8e93708b89daff55026d3b216 Mon Sep 17 00:00:00 2001 From: mm Date: Fri, 22 Mar 2013 10:17:42 +0000 Subject: Replace deprecated (or remove obsolete) libarchive 2.8 functions with libarchive 3.0 counterparts --- usr.bin/ar/acpyacc.y | 7 +++---- usr.bin/ar/read.c | 5 ++--- usr.bin/ar/write.c | 6 ++---- 3 files changed, 7 insertions(+), 11 deletions(-) (limited to 'usr.bin/ar') diff --git a/usr.bin/ar/acpyacc.y b/usr.bin/ar/acpyacc.y index 5d15e8d..456ee1f 100644 --- a/usr.bin/ar/acpyacc.y +++ b/usr.bin/ar/acpyacc.y @@ -249,13 +249,12 @@ arscp_open(char *fname) if ((a = archive_read_new()) == NULL) bsdar_errc(bsdar, EX_SOFTWARE, 0, "archive_read_new failed"); - archive_read_support_compression_none(a); archive_read_support_format_ar(a); - AC(archive_read_open_file(a, fname, DEF_BLKSZ)); + AC(archive_read_open_filename(a, fname, DEF_BLKSZ)); if ((r = archive_read_next_header(a, &entry))) bsdar_warnc(bsdar, 0, "%s", archive_error_string(a)); AC(archive_read_close(a)); - AC(archive_read_finish(a)); + AC(archive_read_free(a)); if (r != ARCHIVE_OK) return; arscp_create(fname, fname); @@ -311,7 +310,7 @@ arscp_create(char *in, char *out) archive_write_set_format_ar_svr4(a); AC(archive_write_open_fd(a, ofd)); AC(archive_write_close(a)); - AC(archive_write_finish(a)); + AC(archive_write_free(a)); } /* Override previous target, if any. */ diff --git a/usr.bin/ar/read.c b/usr.bin/ar/read.c index 8df170d..e595869 100644 --- a/usr.bin/ar/read.c +++ b/usr.bin/ar/read.c @@ -87,9 +87,8 @@ read_archive(struct bsdar *bsdar, char mode) if ((a = archive_read_new()) == NULL) bsdar_errc(bsdar, EX_SOFTWARE, 0, "archive_read_new failed"); - archive_read_support_compression_none(a); archive_read_support_format_ar(a); - AC(archive_read_open_file(a, bsdar->filename, DEF_BLKSZ)); + AC(archive_read_open_filename(a, bsdar->filename, DEF_BLKSZ)); for (;;) { r = archive_read_next_header(a, &entry); @@ -200,5 +199,5 @@ read_archive(struct bsdar *bsdar, char mode) } } AC(archive_read_close(a)); - AC(archive_read_finish(a)); + AC(archive_read_free(a)); } diff --git a/usr.bin/ar/write.c b/usr.bin/ar/write.c index ca348c2..9ce1806 100644 --- a/usr.bin/ar/write.c +++ b/usr.bin/ar/write.c @@ -277,7 +277,6 @@ read_objs(struct bsdar *bsdar, const char *archive, int checkargv) if ((a = archive_read_new()) == NULL) bsdar_errc(bsdar, EX_SOFTWARE, 0, "archive_read_new failed"); - archive_read_support_compression_none(a); archive_read_support_format_ar(a); AC(archive_read_open_filename(a, archive, DEF_BLKSZ)); for (;;) { @@ -363,7 +362,7 @@ read_objs(struct bsdar *bsdar, const char *archive, int checkargv) TAILQ_INSERT_TAIL(&bsdar->v_obj, obj, objs); } AC(archive_read_close(a)); - AC(archive_read_finish(a)); + AC(archive_read_free(a)); } /* @@ -628,7 +627,6 @@ write_objs(struct bsdar *bsdar) bsdar_errc(bsdar, EX_SOFTWARE, 0, "archive_write_new failed"); archive_write_set_format_ar_svr4(a); - archive_write_set_compression_none(a); AC(archive_write_open_filename(a, bsdar->filename)); @@ -682,7 +680,7 @@ write_objs(struct bsdar *bsdar) } AC(archive_write_close(a)); - AC(archive_write_finish(a)); + AC(archive_write_free(a)); } /* -- cgit v1.1