summaryrefslogtreecommitdiff
path: root/lib/backend
diff options
context:
space:
mode:
authorPanu Matilainen <pmatilai@redhat.com>2009-09-16 11:56:12 +0300
committerPanu Matilainen <pmatilai@redhat.com>2009-09-16 15:47:10 +0300
commit2bfa9ca1470d6616a4fe282a18ae0be7be097854 (patch)
treeeff8d4d9ad510272b45b320f128def9c1ff345bd /lib/backend
parentcc1a7acef9aef29218f1671760be0ac06499268b (diff)
downloadlibrpm-tizen-2bfa9ca1470d6616a4fe282a18ae0be7be097854.tar.gz
librpm-tizen-2bfa9ca1470d6616a4fe282a18ae0be7be097854.tar.bz2
librpm-tizen-2bfa9ca1470d6616a4fe282a18ae0be7be097854.zip
Remove unnecessary arguments to db init and fini
- bdb environments are per db_home, not per file so dbfile etc dont make sense here
Diffstat (limited to 'lib/backend')
-rw-r--r--lib/backend/db3.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/lib/backend/db3.c b/lib/backend/db3.c
index 9f0f9410f..b7f1102ff 100644
--- a/lib/backend/db3.c
+++ b/lib/backend/db3.c
@@ -157,9 +157,7 @@ static int cvtdberr(dbiIndex dbi, const char * msg, int error, int printit)
return rc;
}
-static int db_fini(dbiIndex dbi, const char * dbhome,
- const char * dbfile,
- const char * dbsubfile)
+static int db_fini(dbiIndex dbi, const char * dbhome)
{
rpmdb rpmdb = dbi->dbi_rpmdb;
DB_ENV * dbenv = rpmdb->db_dbenv;
@@ -171,9 +169,7 @@ static int db_fini(dbiIndex dbi, const char * dbhome,
rc = dbenv->close(dbenv, 0);
rc = cvtdberr(dbi, "dbenv->close", rc, _debug);
- if (dbfile)
- rpmlog(RPMLOG_DEBUG, "closed db environment %s/%s\n",
- dbhome, dbfile);
+ rpmlog(RPMLOG_DEBUG, "closed db environment %s\n", dbhome);
if (rpmdb->db_remove_env) {
int xx;
@@ -183,9 +179,7 @@ static int db_fini(dbiIndex dbi, const char * dbhome,
xx = dbenv->remove(dbenv, dbhome, 0);
xx = cvtdberr(dbi, "dbenv->remove", xx, _debug);
- if (dbfile)
- rpmlog(RPMLOG_DEBUG, "removed db environment %s/%s\n",
- dbhome, dbfile);
+ rpmlog(RPMLOG_DEBUG, "removed db environment %s\n", dbhome);
}
return rc;
@@ -218,10 +212,7 @@ static int db3isalive(DB_ENV *dbenv, pid_t pid, db_threadid_t tid, uint32_t flag
}
#endif
-static int db_init(dbiIndex dbi, const char * dbhome,
- const char * dbfile,
- const char * dbsubfile,
- DB_ENV ** dbenvp)
+static int db_init(dbiIndex dbi, const char * dbhome, DB_ENV ** dbenvp)
{
rpmdb rpmdb = dbi->dbi_rpmdb;
DB_ENV *dbenv = NULL;
@@ -238,11 +229,9 @@ static int db_init(dbiIndex dbi, const char * dbhome,
eflags = (dbi->dbi_oeflags | dbi->dbi_eflags);
if (eflags & DB_JOINENV) eflags &= DB_JOINENV;
- if (dbfile) {
- char *dbiflags = prDbiOpenFlags(eflags, 1);
- rpmlog(RPMLOG_DEBUG, "opening db environment %s/%s %s\n",
- dbhome, dbfile, dbiflags);
- free(dbiflags);
+ { char *fstr = prDbiOpenFlags(eflags, 1);
+ rpmlog(RPMLOG_DEBUG, "opening db environment %s %s\n", dbhome, fstr);
+ free(fstr);
}
/* XXX Can't do RPC w/o host. */
@@ -626,7 +615,7 @@ static int db3close(dbiIndex dbi, unsigned int flags)
if (rpmdb->db_dbenv != NULL && dbi->dbi_use_dbenv) {
if (rpmdb->db_opens == 1) {
- xx = db_fini(dbi, (dbhome ? dbhome : ""), dbfile, dbsubfile);
+ xx = db_fini(dbi, (dbhome ? dbhome : ""));
rpmdb->db_dbenv = NULL;
}
rpmdb->db_opens--;
@@ -870,7 +859,7 @@ static int db3open(rpmdb rpmdb, rpmTag rpmtag, dbiIndex * dbip)
if (dbi->dbi_use_dbenv) {
if (rpmdb->db_dbenv == NULL) {
- rc = db_init(dbi, dbhome, dbfile, dbsubfile, &dbenv);
+ rc = db_init(dbi, dbhome, &dbenv);
if (rc == 0) {
rpmdb->db_dbenv = dbenv;
rpmdb->db_opens = 1;