db_sql_query(db, cleanup_running_job, NULL, NULL);
}
+ /* Set type in global for debugging */
+ set_db_type(db_get_type(db));
+
db_close_database(NULL, db);
}
return OK;
/* Allow only one thread to tweak d->fd at a time */
static pthread_mutex_t fides_mutex = PTHREAD_MUTEX_INITIALIZER;
static MSGS *daemon_msgs; /* global messages */
+static char *catalog_db = NULL; /* database type */
static void (*message_callback)(int type, char *msg) = NULL;
static FILE *trace_fd = NULL;
#if defined(HAVE_WIN32)
}
}
+void
+set_db_type(const char *name)
+{
+ if (catalog_db != NULL) {
+ free(catalog_db);
+ }
+ catalog_db = bstrdup(name);
+}
+
/*
* Initialize message handler for a daemon or a Job
* We make a copy of the MSGS resource passed, so it belows
fclose(trace_fd);
trace_fd = NULL;
}
+ if (catalog_db) {
+ free(catalog_db);
+ catalog_db = NULL;
+ }
term_last_jobs_list();
}
void free_msgs_res (MSGS *msgs);
void dequeue_messages (JCR *jcr);
void set_trace (int trace_flag);
+void set_db_type (const char *name);
void register_message_callback(void msg_callback(int type, char *msg));
/* bnet_server.c */