X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=bacula%2Fsrc%2Fstored%2Fstored.c;h=71d635ed755490950af44a604aebf644e448d287;hb=36b40d5c7f3ff90565ab73ac75f0dc4f6660ff37;hp=36ae297f397233add3cce53abebfeda2adcb3a6c;hpb=21ad4ba4160bb72105d6c1e2011e2e31b61f20ad;p=bacula%2Fbacula diff --git a/bacula/src/stored/stored.c b/bacula/src/stored/stored.c index 36ae297f39..71d635ed75 100644 --- a/bacula/src/stored/stored.c +++ b/bacula/src/stored/stored.c @@ -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();