From ef86da97f54a90ee4ba3ba8ea7963135e7bae8ed Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 28 Jan 2011 17:41:15 -0600 Subject: Remove need to explicitly register the local DB Perform the cheap struct and string setup of the local DB at handle initialization time to match the teardown we do when releasing the handle. If the local DB is not needed, all real initialization is done lazily after DB paths and other things have been configured anyway. Signed-off-by: Dan McGee --- lib/libalpm/be_local.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'lib/libalpm/be_local.c') diff --git a/lib/libalpm/be_local.c b/lib/libalpm/be_local.c index ea59ceca..9602c825 100644 --- a/lib/libalpm/be_local.c +++ b/lib/libalpm/be_local.c @@ -400,7 +400,7 @@ static int local_db_populate(pmdb_t *db) pkg = _alpm_pkg_new(); if(pkg == NULL) { closedir(dbdir); - return(-1); + RET_ERR(PM_ERR_MEMORY, -1); } /* split the db entry name */ if(_alpm_splitname(name, pkg) != 0) { @@ -900,11 +900,6 @@ pmdb_t *_alpm_db_register_local(void) ALPM_LOG_FUNC; - if(handle->db_local != NULL) { - _alpm_log(PM_LOG_WARNING, _("attempt to re-register the 'local' DB\n")); - RET_ERR(PM_ERR_DB_NOT_NULL, NULL); - } - _alpm_log(PM_LOG_DEBUG, "registering local database\n"); db = _alpm_db_new("local", 1); -- cgit v1.2.3-24-g4f1b