*mdb->errmsg = 0;
mdb->cmd = get_pool_memory(PM_EMSG); /* command buffer */
mdb->ref_count = 1;
+ mdb->cached_path = get_pool_memory(PM_FNAME);
+ mdb->cached_path_id = 0;
qinsert(&db_list, &mdb->bq); /* put db in list */
Dmsg0(200, "Done db_open_database()\n");
mdb->cfd = -1;
{
char *dbf;
int fd, badctl;
- int errstat;
off_t filend;
Dmsg1(200, "db_open_database() %s\n", mdb->db_name);
P(mutex);
-#ifdef needed
- if ((errstat = pthread_mutex_init(&(mdb->mutex), NULL)) != 0) {
- Mmsg1(&mdb->errmsg, "Unable to initialize DB mutex. ERR=%s\n", strerror(errstat));
- V(mutex);
- return 0;
- }
- db_lock(mdb); /* test it once */
- db_unlock(mdb);
-#endif
if (rwl_init(&mdb->lock) != 0) {
Mmsg1(&mdb->errmsg, "Unable to initialize DB lock. ERR=%s\n", strerror(errno));
rwl_destroy(&mdb->lock);
free_pool_memory(mdb->errmsg);
free_pool_memory(mdb->cmd);
+ free_pool_memory(mdb->cached_path);
free(mdb);
}
V(mutex);