From 04e195284e0439436143a297a561aef1a6c35b17 Mon Sep 17 00:00:00 2001 From: Aurelien Foret Date: Wed, 16 Mar 2005 22:06:31 +0000 Subject: Code cleanup --- lib/libalpm/alpm.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib/libalpm/alpm.c') diff --git a/lib/libalpm/alpm.c b/lib/libalpm/alpm.c index 9dc6556b..a6e2c2dd 100644 --- a/lib/libalpm/alpm.c +++ b/lib/libalpm/alpm.c @@ -50,8 +50,8 @@ #include "handle.h" #include "alpm.h" +/* Globals */ pmhandle_t *handle = NULL; - enum __pmerrno_t pm_errno; /* @@ -132,6 +132,7 @@ int alpm_get_option(unsigned char parm, long *data) { /* Sanity checks */ ASSERT(handle != NULL, PM_RET_ERR(PM_ERR_HANDLE_NULL, -1)); + ASSERT(data != NULL, PM_RET_ERR(PM_ERR_WRONG_ARGS, -1)); return(handle_get_option(handle, parm, data)); } @@ -147,7 +148,9 @@ int alpm_db_register(char *treename, PM_DB **db) ASSERT(treename != NULL && strlen(treename) != 0, PM_RET_ERR(PM_ERR_WRONG_ARGS, -1)); ASSERT(db != NULL, PM_RET_ERR(PM_ERR_WRONG_ARGS, -1)); - /* check if the db if already registered */ + /* ORE + check if the db if already registered */ + *db = db_open(handle->root, handle->dbpath, treename); if(*db == NULL) { /* couldn't open the db directory - try creating it */ -- cgit v1.2.3-24-g4f1b