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>
This commit is contained in:
Dan McGee 2011-01-11 21:13:04 -06:00
parent 6942bba75d
commit 25fab402c7
1 changed files with 7 additions and 0 deletions

View File

@ -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);