diff --git a/src/dird/dird.c b/src/dird/dird.c index ef7b570d5f4..6c8db0e0532 100644 --- a/src/dird/dird.c +++ b/src/dird/dird.c @@ -1062,7 +1062,6 @@ static bool check_resources() } } - UnlockRes(); if (OK) { close_msg(NULL); /* close temp message handler */ init_msg(NULL, me->messages); /* open daemon message handler */ @@ -1075,6 +1074,7 @@ static bool check_resources() } bail_out: + UnlockRes(); return OK; } diff --git a/src/dird/ua_cmds.c b/src/dird/ua_cmds.c index dea092fcfb6..a64b1d95cf4 100644 --- a/src/dird/ua_cmds.c +++ b/src/dird/ua_cmds.c @@ -357,7 +357,7 @@ static struct ua_cmdstruct commands[] = { NT_("job= client= fileset= level=\n" "\tstorage= where= when=\n" "\tpool= pluginoptions= accurate= comment=\n" - "\tspooldata= priority= jobid= catalog= migrationjob=<>\n" + "\tspooldata= priority= jobid= catalog= migrationjob=\n" "\tbackupclient= backupformat= nextpool=\n" "\tsince= verifyjob= verifylist=\n" "\tmigrationjob= yes"), false, true }, diff --git a/src/dird/ua_configure.c b/src/dird/ua_configure.c index 2ed5b100ff6..55269fb32b6 100644 --- a/src/dird/ua_configure.c +++ b/src/dird/ua_configure.c @@ -43,23 +43,12 @@ static void configure_lex_error_handler(const char *file, int line, LEX *lc, con /* * This function is an error handler, used by lex. */ - va_list ap; - int len, maxlen; POOL_MEM buf(PM_NAME); + va_list ap; - while (1) { - maxlen = buf.size() - 1; - va_start(ap, msg); - len = bvsnprintf(buf.c_str(), maxlen, msg, ap); - va_end(ap); - - if (len < 0 || len >= (maxlen - 5)) { - buf.realloc_pm(maxlen + maxlen / 2); - continue; - } - - break; - } + va_start(ap, msg); + buf.bvsprintf(msg, ap); + va_end(ap); configure_lex_error_handler(file, line, lc, buf); } diff --git a/src/lib/lex.c b/src/lib/lex.c index 50e158e9c32..6b8c8d2643a 100644 --- a/src/lib/lex.c +++ b/src/lib/lex.c @@ -110,6 +110,8 @@ static void s_err(const char *file, int line, LEX *lc, const char *msg, ...) } else { e_msg(file, line, lc->err_type, 0, _("Config error: %s\n"), buf.c_str()); } + + lc->error_counter++; } /* @@ -199,6 +201,7 @@ LEX *lex_close_file(LEX *lf) lf->line = NULL; if (of) { of->options = lf->options; /* preserve options */ + of->error_counter += lf->error_counter; /* summarize the errors */ memcpy(lf, of, sizeof(LEX)); Dmsg1(dbglvl, "Restart scan of cfg file %s\n", of->fname); } else { @@ -209,32 +212,6 @@ LEX *lex_close_file(LEX *lf) return lf; } -LEX *lex_close_buffer(LEX *lf) -{ - LEX *of; - - if (lf == NULL) { - Emsg0(M_ABORT, 0, _("Close of NULL file\n")); - } - - of = lf->next; - - free_memory(lf->line); - free_memory(lf->str); - lf->line = NULL; - if (of) { - of->options = lf->options; /* preserve options */ - memcpy(lf, of, sizeof(LEX)); - Dmsg1(dbglvl, "Restart scan of cfg file %s\n", of->fname); - } else { - of = lf; - lf = NULL; - } - free(of); - - return lf; -} - /* * Add lex structure for an included config file. */ diff --git a/src/lib/protos.h b/src/lib/protos.h index d1506d6e130..bb3a40e2ec7 100644 --- a/src/lib/protos.h +++ b/src/lib/protos.h @@ -265,7 +265,6 @@ void initialize_json(); /* lex.c */ LEX *lex_close_file(LEX *lf); -LEX *lex_close_buffer(LEX *lf); LEX *lex_open_file(LEX *lf, const char *fname, LEX_ERROR_HANDLER *scan_error, diff --git a/src/lib/res.c b/src/lib/res.c index 82a1fda76a5..b66da376f8d 100644 --- a/src/lib/res.c +++ b/src/lib/res.c @@ -49,7 +49,7 @@ union URES { static int res_locked = 0; /* resource chain lock count -- for debug */ -/* #define TRACE_RES */ +// #define TRACE_RES void b_LockRes(const char *file, int line) { @@ -60,7 +60,7 @@ void b_LockRes(const char *file, int line) res_locked, my_config->m_res_lock.w_active, file, line); if (res_locked) { - Pmsg2(000, "LockRes writerid=%d myid=%d\n", + Pmsg2(000, "LockRes writerid=%lu myid=%lu\n", my_config->m_res_lock.writer_id, pthread_self()); } #endif