summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-06-09 22:23:24 +0200
committerDan McGee <dan@archlinux.org>2011-06-14 15:39:02 +0200
commitba63e31cc7ecc9e7fccb68e9fa4e09c90a8d5c66 (patch)
tree2989f068ce3104646c2dbdc616b47ca89d52cd98 /lib
parent0074cadb3bfdf5d89065e69eb93788ebcc9a6b58 (diff)
downloadpacman-ba63e31cc7ecc9e7fccb68e9fa4e09c90a8d5c66.tar.gz
pacman-ba63e31cc7ecc9e7fccb68e9fa4e09c90a8d5c66.tar.xz
Small handle related cleanups
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/be_package.c3
-rw-r--r--lib/libalpm/package.c3
-rw-r--r--lib/libalpm/sync.c2
3 files changed, 3 insertions, 5 deletions
diff --git a/lib/libalpm/be_package.c b/lib/libalpm/be_package.c
index e65db498..1f20989d 100644
--- a/lib/libalpm/be_package.c
+++ b/lib/libalpm/be_package.c
@@ -92,8 +92,7 @@ static size_t _package_changelog_read(void *ptr, size_t size,
ssize_t sret = archive_read_data((struct archive *)fp, ptr, size);
/* Report error (negative values) */
if(sret < 0) {
- pkg->handle->pm_errno = PM_ERR_LIBARCHIVE;
- return 0;
+ RET_ERR(pkg->handle, PM_ERR_LIBARCHIVE, 0);
} else {
return (size_t)sret;
}
diff --git a/lib/libalpm/package.c b/lib/libalpm/package.c
index 61194e91..014dedce 100644
--- a/lib/libalpm/package.c
+++ b/lib/libalpm/package.c
@@ -341,8 +341,7 @@ alpm_list_t SYMEXPORT *alpm_pkg_compute_requiredby(pmpkg_t *pkg)
if(pkg->origin == PKG_FROM_FILE) {
/* The sane option; search locally for things that require this. */
- db = alpm_option_get_localdb(pkg->handle);
- find_requiredby(pkg, db, &reqs);
+ find_requiredby(pkg, pkg->handle->db_local, &reqs);
} else {
/* We have a DB package. if it is a local package, then we should
* only search the local DB; else search all known sync databases. */
diff --git a/lib/libalpm/sync.c b/lib/libalpm/sync.c
index bd92992a..d65f5e20 100644
--- a/lib/libalpm/sync.c
+++ b/lib/libalpm/sync.c
@@ -275,7 +275,7 @@ static int compute_download_size(pmpkg_t *newpkg)
off_t dltsize;
off_t pkgsize = alpm_pkg_get_size(newpkg);
- dltsize = _alpm_shortest_delta_path(newpkg->handle,
+ dltsize = _alpm_shortest_delta_path(handle,
alpm_pkg_get_deltas(newpkg),
alpm_pkg_get_filename(newpkg),
&newpkg->delta_path);