only use a cursor when needed, from Derrick J Brashear

<shadow@dementia.org>


git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@8563 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
2000-07-06 21:40:29 +00:00
parent 7ee7f8575a
commit 0aa12ef99f

View File

@@ -40,6 +40,9 @@ static krb5_error_code
DB_close(krb5_context context, HDB *db)
{
DB *d = (DB*)db->db;
DBC *dbcp = (DBC*)db->dbc;
if (dbcp)
dbcp->c_close(dbcp);
d->close(d, 0);
return 0;
}
@@ -90,7 +93,8 @@ DB_seq(krb5_context context, HDB *db,
memset(&value, 0, sizeof(DBT));
if (db->lock(context, db, HDB_RLOCK))
return HDB_ERR_DB_INUSE;
code = d->cursor(d, NULL, (DBC **)&db->dbc, 0);
if (!db->dbc)
code = d->cursor(d, NULL, (DBC **)&db->dbc, 0);
if (code)
return code;
dbcp=db->dbc;