]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/stored/stored.c
kes Define a machine dependent ioctl request type for use with
[bacula/bacula] / bacula / src / stored / stored.c
index 36ae297f397233add3cce53abebfeda2adcb3a6c..71d635ed755490950af44a604aebf644e448d287 100644 (file)
@@ -20,7 +20,7 @@
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
    02110-1301, USA.
 
-   Bacula® is a registered trademark of John Walker.
+   Bacula® is a registered trademark of Kern Sibbald.
    The licensor of Bacula is the Free Software Foundation Europe
    (FSFE), Fiduciary Program, Sumatrastrasse 25, 8006 Zürich,
    Switzerland, email:ftf@fsfeurope.org.
@@ -43,7 +43,7 @@
 #include "stored.h"
 
 /* Imported functions */
-
+extern bool parse_sd_config(CONFIG *config, const char *configfile, int exit_code);
 
 /* Forward referenced functions */
 void terminate_stored(int sig);
@@ -73,6 +73,7 @@ bool init_done = false;
 static bool foreground = 0;
 static pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;
 static workq_t dird_workq;            /* queue for processing connections */
+static CONFIG *config;
 
 
 static void usage()
@@ -209,7 +210,8 @@ int main (int argc, char *argv[])
       configfile = bstrdup(CONFIG_FILE);
    }
 
-   parse_config(configfile);
+   config = new_config_parser();
+   parse_sd_config(config, configfile, M_ERROR_TERM);
 
    if (init_crypto() != 0) {
       Jmsg((JCR *)NULL, M_ERROR_TERM, 0, _("Cryptography library initialization failed.\n"));
@@ -480,7 +482,7 @@ void *device_initialization(void *arg)
 
    pthread_detach(pthread_self());
    jcr = new_jcr(sizeof(JCR), stored_free_jcr);
-   jcr->JobType = JT_SYSTEM;
+   jcr->set_JobType(JT_SYSTEM);
    /* Initialize FD start condition variable */
    int errstat = pthread_cond_init(&jcr->job_start_wait, NULL);
    if (errstat != 0) {
@@ -614,7 +616,11 @@ void terminate_stored(int sig)
       free(configfile);
       configfile = NULL;
    }
-   free_config_resources();
+   if (config) {
+      config->free_resources();
+      free(config);
+      config = NULL;
+  }
 
    if (debug_level > 10) {
       print_memory_pool_stats();