diff options
author | Dan McGee <dan@archlinux.org> | 2011-05-05 20:25:10 +0200 |
---|---|---|
committer | Dan McGee <dan@archlinux.org> | 2011-05-05 20:25:10 +0200 |
commit | 6b308d89f97340c16e3e805afcc80d70a1c5eebe (patch) | |
tree | 3dddd359d462fea54ba75350caa492a93f450a05 /lib/libalpm/be_sync.c | |
parent | f2d696cd515ef0365d9708eb3d1caa439e2cc790 (diff) | |
parent | b14c5477e5e4483352d304a1e97de5922948b934 (diff) | |
download | pacman-6b308d89f97340c16e3e805afcc80d70a1c5eebe.tar.gz pacman-6b308d89f97340c16e3e805afcc80d70a1c5eebe.tar.xz |
Merge branch 'maint'
Diffstat (limited to 'lib/libalpm/be_sync.c')
-rw-r--r-- | lib/libalpm/be_sync.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c index c38e232c..cd4a8667 100644 --- a/lib/libalpm/be_sync.c +++ b/lib/libalpm/be_sync.c @@ -246,8 +246,9 @@ static int sync_db_populate(pmdb_t *db) ASSERT(db != NULL, RET_ERR(PM_ERR_DB_NULL, -1)); - if((archive = archive_read_new()) == NULL) - RET_ERR(PM_ERR_LIBARCHIVE, 1); + if((archive = archive_read_new()) == NULL) { + RET_ERR(PM_ERR_LIBARCHIVE, -1); + } archive_read_support_compression_all(archive); archive_read_support_format_all(archive); @@ -255,7 +256,7 @@ static int sync_db_populate(pmdb_t *db) dbpath = _alpm_db_path(db); if(!dbpath) { /* pm_errno set in _alpm_db_path() */ - return 1; + return -1; } _alpm_log(PM_LOG_DEBUG, "opening database archive %s\n", dbpath); @@ -265,10 +266,10 @@ static int sync_db_populate(pmdb_t *db) _alpm_log(PM_LOG_ERROR, _("could not open file %s: %s\n"), dbpath, archive_error_string(archive)); archive_read_finish(archive); - RET_ERR(PM_ERR_DB_OPEN, 1); + RET_ERR(PM_ERR_DB_OPEN, -1); } if(stat(dbpath, &buf) != 0) { - RET_ERR(PM_ERR_DB_OPEN, 1); + RET_ERR(PM_ERR_DB_OPEN, -1); } est_count = estimate_package_count(&buf, archive); |