diff options
author | sjg <sjg@FreeBSD.org> | 2013-04-12 20:48:55 +0000 |
---|---|---|
committer | sjg <sjg@FreeBSD.org> | 2013-04-12 20:48:55 +0000 |
commit | 97d8b9495668afa398ab17c8c5f7e223b5fd2e89 (patch) | |
tree | 54038c9ac32a45f8741dcc23fb9a8ffc0e15ff89 /usr.bin/ar | |
parent | 5ee3bfdb338e7c80af29a67f4425c4be24c7b866 (diff) | |
parent | 086d73aef6d0ab7d21daa2076fdc8d25961f9b05 (diff) | |
download | FreeBSD-src-97d8b9495668afa398ab17c8c5f7e223b5fd2e89.zip FreeBSD-src-97d8b9495668afa398ab17c8c5f7e223b5fd2e89.tar.gz |
sync from head
Diffstat (limited to 'usr.bin/ar')
-rw-r--r-- | usr.bin/ar/Makefile | 4 | ||||
-rw-r--r-- | usr.bin/ar/acpyacc.y | 7 | ||||
-rw-r--r-- | usr.bin/ar/read.c | 5 | ||||
-rw-r--r-- | usr.bin/ar/write.c | 6 |
4 files changed, 9 insertions, 13 deletions
diff --git a/usr.bin/ar/Makefile b/usr.bin/ar/Makefile index e9bb893..fa25072 100644 --- a/usr.bin/ar/Makefile +++ b/usr.bin/ar/Makefile @@ -5,8 +5,8 @@ PROG= ar SRCS= ar.c acplex.l acpyacc.y read.c util.c write.c y.tab.h -DPADD= ${LIBARCHIVE} ${LIBELF} -LDADD= -larchive -lelf +DPADD= ${LIBARCHIVE} ${LIBELF} ${LIBZ} +LDADD= -larchive -lelf -lz CFLAGS+=-I. -I${.CURDIR} 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)); } /* |