[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug fix for db3 support



I didn't notice this when I was working on the db3 support. It only shows
up when you do an iterative operation like kadmin dump, and I realized
what the problem was quite quickly.

This approach opens a cursor only if needed, and closes it when the
database is closed.

-D

*** /usr/src/heimdal/new/lib/hdb/db3.c	Sun Jun  4 21:09:45 2000
--- ./db3.c	Tue Jun 27 23:18:37 2000
***************
*** 40,45 ****
--- 40,48 ----
  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,96 ****
      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 (code)
  	return code;
      dbcp=db->dbc;
--- 93,100 ----
      memset(&value, 0, sizeof(DBT));
      if (db->lock(context, db, HDB_RLOCK))
  	return HDB_ERR_DB_INUSE;
!     if (!db->dbc)
!       code = d->cursor(d, NULL, (DBC **)&db->dbc, 0);
      if (code)
  	return code;
      dbcp=db->dbc;