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/alpm.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/libalpm/alpm.c') diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index 2a9f4605..7c3bfc26 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -54,6 +54,10 @@ int SYMEXPORT alpm_initialize(void) if(handle == NULL) { RET_ERR(PM_ERR_MEMORY, -1); } + if(_alpm_db_register_local() == NULL) { + /* error code should be set */ + return(-1); + } #ifdef ENABLE_NLS bindtextdomain("libalpm", LOCALEDIR); -- cgit v1.2.3-24-g4f1b