summaryrefslogtreecommitdiffstats
path: root/lib/libalpm/alpm.c
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-01-29 00:41:15 +0100
committerDan McGee <dan@archlinux.org>2011-01-29 19:13:56 +0100
commitef86da97f54a90ee4ba3ba8ea7963135e7bae8ed (patch)
tree99c492d170d3780ac2530413031593cc248a8fd3 /lib/libalpm/alpm.c
parent9b876fff09f2af10cba6824bec03d8fe3e167b5b (diff)
downloadpacman-ef86da97f54a90ee4ba3ba8ea7963135e7bae8ed.tar.gz
pacman-ef86da97f54a90ee4ba3ba8ea7963135e7bae8ed.tar.xz
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 <dan@archlinux.org>
Diffstat (limited to 'lib/libalpm/alpm.c')
-rw-r--r--lib/libalpm/alpm.c4
1 files changed, 4 insertions, 0 deletions
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);