summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/util.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2007-08-14 10:14:35 -0400
committerDan McGee <dan@archlinux.org>2007-08-14 10:14:35 -0400
commita65ad4efc1102449a087b464d3b8d4670a614b99 (patch)
tree3131b4392641667c5d289d87eaccca976244aee1 /lib/libalpm/util.c
parent49c29e16b31ce35e81be210bc74a3834530bb9e0 (diff)
downloadpacman-a65ad4efc1102449a087b464d3b8d4670a614b99.tar.xz
package.h: implement origin_data union in pmpkg_t struct
We were using a void *data element in pmpkg_t before, which is unsafe by its nature of being untyped. Reimplement data as origin_data being a union that can hold either a path to a package file or a pointer to a cache database, and make the other necesary updates in the code to reflect this. See package.h for details. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/util.c')
-rw-r--r--lib/libalpm/util.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libalpm/util.c b/lib/libalpm/util.c
index 5ead8a26..ddc3edcc 100644
--- a/lib/libalpm/util.c
+++ b/lib/libalpm/util.c
@@ -396,7 +396,8 @@ int _alpm_unpack(const char *archive, const char *prefix, const char *fn)
archive_read_support_compression_all(_archive);
archive_read_support_format_all(_archive);
- if(archive_read_open_file(_archive, archive, ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) {
+ if(archive_read_open_filename(_archive, archive,
+ ARCHIVE_DEFAULT_BYTES_PER_BLOCK) != ARCHIVE_OK) {
_alpm_log(PM_LOG_ERROR, _("could not open %s: %s\n"), archive, archive_error_string(_archive));
RET_ERR(PM_ERR_PKG_OPEN, -1);
}