diff options
author | Dan McGee <dan@archlinux.org> | 2011-01-11 21:13:04 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-01-11 21:15:24 -0600 |
commit | 25fab402c79aeaa5b72959c7bfd2e541a1b34045 (patch) | |
tree | 857e510e563521f2d2d0023dacba5ba29d0330bf /lib/libalpm | |
parent | 6942bba75db596a70d5ba408785bf461e691bc9c (diff) | |
download | pacman-25fab402c79aeaa5b72959c7bfd2e541a1b34045.tar.xz |
Call archive_read_data_skip() while checking diskspace
libarchive eventually calls it anyway, but backtraces make a lot more sense
if we call it, as well as matching our precedent from alpm_pkg_load().
Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm')
-rw-r--r-- | lib/libalpm/diskspace.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/libalpm/diskspace.c b/lib/libalpm/diskspace.c index b3c340af..dfafdac0 100644 --- a/lib/libalpm/diskspace.c +++ b/lib/libalpm/diskspace.c @@ -232,6 +232,13 @@ static int calculate_installed_size(const alpm_list_t *mount_points, data->blocks_needed += (archive_entry_size(entry) + data->fsp.f_bsize - 1l) / data->fsp.f_bsize; data->used = 1; + + if(archive_read_data_skip(archive)) { + _alpm_log(PM_LOG_ERROR, _("error while reading package %s: %s\n"), + pkg->name, archive_error_string(archive)); + pm_errno = PM_ERR_LIBARCHIVE; + break; + } } archive_read_finish(archive); |