index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Dan McGee <dan@archlinux.org> | 2011-02-15 16:56:44 -0600 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-02-15 16:58:08 -0600 |
commit | d1cc1ef6c31dc193adcf48a9aea4a95830c7ae56 (patch) | |
tree | a0808496f537757e32cfc25b0bd83c14a98a6fb0 /lib/libalpm/be_sync.c | |
parent | 62a2e45b12f746c098523782fb5889793ef59687 (diff) |
-rw-r--r-- | lib/libalpm/be_sync.c | 9 |
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index 4e9b4d31..69f7663d 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -171,7 +171,7 @@ static int sync_db_read(pmdb_t *db, struct archive *archive, * Unweighted Avg 2543.39 118.74 190.16 137.93 * Average of Avgs 2564.44 124.08 191.06 143.46 */ -static int estimate_package_count(struct stat *st, struct archive *archive) +static size_t estimate_package_count(struct stat *st, struct archive *archive) { unsigned int per_package; @@ -199,12 +199,13 @@ static int estimate_package_count(struct stat *st, struct archive *archive) /* assume it is at least somewhat compressed */ per_package = 200; } - return((int)(st->st_size / per_package) + 1); + return((size_t)(st->st_size / per_package) + 1); } static int sync_db_populate(pmdb_t *db) { - int est_count, count = 0; + size_t est_count; + int count = 0; struct stat buf; struct archive *archive; struct archive_entry *entry; @@ -227,7 +228,7 @@ static int sync_db_populate(pmdb_t *db) archive_read_finish(archive); RET_ERR(PM_ERR_DB_OPEN, 1); } - if(lstat(_alpm_db_path(db), &buf) != 0) { + if(stat(_alpm_db_path(db), &buf) != 0) { RET_ERR(PM_ERR_DB_OPEN, 1); } est_count = estimate_package_count(&buf, archive); |