Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src Use libarchive 3.x interface and not obsolete 2.x versions.



details:   https://anonhg.NetBSD.org/src/rev/f5056367d414
branches:  trunk
changeset: 823364:f5056367d414
user:      joerg <joerg%NetBSD.org@localhost>
date:      Thu Apr 20 13:11:35 2017 +0000

description:
Use libarchive 3.x interface and not obsolete 2.x versions.

diffstat:

 usr.bin/unzip/unzip.c          |   7 +++----
 usr.sbin/makemandb/makemandb.c |  12 ++++++------
 2 files changed, 9 insertions(+), 10 deletions(-)

diffs (82 lines):

diff -r f3c8c6f8999d -r f5056367d414 usr.bin/unzip/unzip.c
--- a/usr.bin/unzip/unzip.c     Thu Apr 20 13:11:03 2017 +0000
+++ b/usr.bin/unzip/unzip.c     Thu Apr 20 13:11:35 2017 +0000
@@ -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 <joerg%NetBSD.org@localhost>
@@ -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 @@
                    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) {
diff -r f3c8c6f8999d -r f5056367d414 usr.sbin/makemandb/makemandb.c
--- a/usr.sbin/makemandb/makemandb.c    Thu Apr 20 13:11:03 2017 +0000
+++ b/usr.sbin/makemandb/makemandb.c    Thu Apr 20 13:11:35 2017 +0000
@@ -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.upadhyay%gmail.com@localhost>
  * Copyright (c) 2011 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
@@ -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 @@
                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 @@
        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 @@
                                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 @@
 
 archive_error:
        warnx("Error while reading `%s': %s", file, archive_error_string(a));
-       archive_read_finish(a);
+       archive_read_free(a);
        return -1;
 }
 



Home | Main Index | Thread Index | Old Index