Module Name: src Committed By: joerg Date: Thu Apr 20 13:11:35 UTC 2017
Modified Files: src/usr.bin/unzip: unzip.c src/usr.sbin/makemandb: makemandb.c Log Message: Use libarchive 3.x interface and not obsolete 2.x versions. To generate a diff of this commit: cvs rdiff -u -r1.22 -r1.23 src/usr.bin/unzip/unzip.c cvs rdiff -u -r1.46 -r1.47 src/usr.sbin/makemandb/makemandb.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/usr.bin/unzip/unzip.c diff -u src/usr.bin/unzip/unzip.c:1.22 src/usr.bin/unzip/unzip.c:1.23 --- src/usr.bin/unzip/unzip.c:1.22 Mon Dec 21 17:17:02 2015 +++ src/usr.bin/unzip/unzip.c Thu Apr 20 13:11:35 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: unzip.c,v 1.22 2015/12/21 17:17:02 christos Exp $ */ +/* $NetBSD: unzip.c,v 1.23 2017/04/20 13:11:35 joerg Exp $ */ /*- * Copyright (c) 2009, 2010 Joerg Sonnenberger <jo...@netbsd.org> @@ -37,7 +37,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: unzip.c,v 1.22 2015/12/21 17:17:02 christos Exp $"); +__RCSID("$NetBSD: unzip.c,v 1.23 2017/04/20 13:11:35 joerg Exp $"); #include <sys/queue.h> #include <sys/stat.h> @@ -902,8 +902,7 @@ unzip(const char *fn) file_count != 1 ? "s" : ""); } - ac(archive_read_close(a)); - (void)archive_read_finish(a); + ac(archive_read_free(a)); if (t_opt) { if (error_count > 0) { Index: src/usr.sbin/makemandb/makemandb.c diff -u src/usr.sbin/makemandb/makemandb.c:1.46 src/usr.sbin/makemandb/makemandb.c:1.47 --- src/usr.sbin/makemandb/makemandb.c:1.46 Mon Dec 19 14:10:57 2016 +++ src/usr.sbin/makemandb/makemandb.c Thu Apr 20 13:11:35 2017 @@ -1,4 +1,4 @@ -/* $NetBSD: makemandb.c,v 1.46 2016/12/19 14:10:57 abhinav Exp $ */ +/* $NetBSD: makemandb.c,v 1.47 2017/04/20 13:11:35 joerg Exp $ */ /* * Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadh...@gmail.com> * Copyright (c) 2011 Kristaps Dzonsons <krist...@bsd.lv> @@ -17,7 +17,7 @@ */ #include <sys/cdefs.h> -__RCSID("$NetBSD: makemandb.c,v 1.46 2016/12/19 14:10:57 abhinav Exp $"); +__RCSID("$NetBSD: makemandb.c,v 1.47 2017/04/20 13:11:35 joerg Exp $"); #include <sys/stat.h> #include <sys/types.h> @@ -690,7 +690,7 @@ read_and_decompress(const char *file, vo errx(EXIT_FAILURE, "memory allocation failed"); *bufp = NULL; - if (archive_read_support_compression_all(a) != ARCHIVE_OK || + if (archive_read_support_filter_all(a) != ARCHIVE_OK || archive_read_support_format_raw(a) != ARCHIVE_OK || archive_read_open_filename(a, file, 65536) != ARCHIVE_OK || archive_read_next_header(a, &ae) != ARCHIVE_OK) @@ -701,7 +701,7 @@ read_and_decompress(const char *file, vo for (;;) { r = archive_read_data(a, buf + off, *len - off); if (r == ARCHIVE_OK) { - archive_read_finish(a); + archive_read_free(a); *bufp = buf; *len = off; return 0; @@ -717,7 +717,7 @@ read_and_decompress(const char *file, vo if (mflags.verbosity) warnx("File too large: %s", file); free(buf); - archive_read_finish(a); + archive_read_free(a); return -1; } buf = erealloc(buf, *len); @@ -726,7 +726,7 @@ read_and_decompress(const char *file, vo archive_error: warnx("Error while reading `%s': %s", file, archive_error_string(a)); - archive_read_finish(a); + archive_read_free(a); return -1; }