diff options
author | joerg <joerg@pkgsrc.org> | 2009-03-08 14:50:36 +0000 |
---|---|---|
committer | joerg <joerg@pkgsrc.org> | 2009-03-08 14:50:36 +0000 |
commit | b02e7e47c4778f2c138dd16cd801c32664677961 (patch) | |
tree | 1a6de50cc608aa738b71aa73162036cd0bb35da0 /pkgtools/pkg_install/files/info | |
parent | c18f14930a09da9fbbf014b15fe75cb9c256da8c (diff) | |
download | pkgsrc-b02e7e47c4778f2c138dd16cd801c32664677961.tar.gz |
pkg_install-20090307:
Simplify archive handling by depending on archive_read_finish and the
close callback where needed. Fixes a file descriptor leak as side
effect as reported by wiz.
Diffstat (limited to 'pkgtools/pkg_install/files/info')
-rw-r--r-- | pkgtools/pkg_install/files/info/perform.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/pkgtools/pkg_install/files/info/perform.c b/pkgtools/pkg_install/files/info/perform.c index 5f605dd2ed3..bb6919dce43 100644 --- a/pkgtools/pkg_install/files/info/perform.c +++ b/pkgtools/pkg_install/files/info/perform.c @@ -1,4 +1,4 @@ -/* $NetBSD: perform.c,v 1.53 2009/03/02 17:13:49 joerg Exp $ */ +/* $NetBSD: perform.c,v 1.54 2009/03/08 14:50:36 joerg Exp $ */ #if HAVE_CONFIG_H #include "config.h" @@ -13,7 +13,7 @@ #if HAVE_SYS_WAIT_H #include <sys/wait.h> #endif -__RCSID("$NetBSD: perform.c,v 1.53 2009/03/02 17:13:49 joerg Exp $"); +__RCSID("$NetBSD: perform.c,v 1.54 2009/03/08 14:50:36 joerg Exp $"); /*- * Copyright (c) 2008 Joerg Sonnenberger <joerg@NetBSD.org>. @@ -339,27 +339,23 @@ pkg_do(const char *pkg) errx(2, "Binary packages not supported during bootstrap"); #else struct archive *archive; - void *archive_cookie; - void *signature_cookie; struct archive_entry *entry; char *pkgname; - archive = open_archive(pkg, &archive_cookie); + archive = open_archive(pkg); if (archive == NULL) { warnx("can't find package `%s', skipped", pkg); return -1; } pkgname = NULL; entry = NULL; - pkg_verify_signature(&archive, &entry, &pkgname, - &signature_cookie); + pkg_verify_signature(&archive, &entry, &pkgname); if (archive == NULL) return -1; free(pkgname); meta = read_meta_data_from_archive(archive, entry); - close_archive(archive_cookie); - pkg_free_signature(signature_cookie); + archive_read_finish(archive); if (!IS_URL(pkg)) binpkgfile = pkg; #endif |