Example #1
0
/* Close the database handle */
static int
tc_db_close (TCADB * adb, char *dbname)
{
  if (adb == NULL)
    return 1;

  /* close the database */
  if (!tcadbclose (adb))
    FATAL ("Unable to close DB: %s", dbname);

  /* delete the object */
  tcadbdel (adb);

#ifdef TCB_BTREE
  /* remove database file */
  if (!conf.keep_db_files && !tcremovelink (dbname))
    LOG_DEBUG (("Unable to remove DB: %s\n", dbname));
#endif
  free (dbname);

  return 0;
}
Example #2
0
/* Close the database handle */
int
tc_bdb_close (void *db, char *dbname)
{
    TCBDB *bdb = db;
    int ecode;

    if (bdb == NULL)
        return 1;

    /* close the database */
    if (!tcbdbclose (bdb)) {
        ecode = tcbdbecode (bdb);
        FATAL ("%s", tcbdberrmsg (ecode));
    }
    /* delete the object */
    tcbdbdel (bdb);

    /* remove database file */
    if (!conf.keep_db_files && !tcremovelink (dbname))
        LOG_DEBUG (("Unable to remove DB: %s\n", dbname));
    free (dbname);

    return 0;
}