]> git.sur5r.net Git - bacula/bacula/blobdiff - bacula/src/lib/parse_conf.c
- Add Scratch to PoolType in PostgreSQL make...tables and do not
[bacula/bacula] / bacula / src / lib / parse_conf.c
index 3f76e4e3e5439893f853ec15c7f800bbfb6b6eb2..c86199e677809ca0f19cd01caf240e16a317da6f 100755 (executable)
@@ -737,6 +737,8 @@ enum parse_state {
  * Parse configuration file
  *
  * Return 0 if reading failed, 1 otherwise
+ *  Note, the default behavior unless you have set an alternate
+ *  scan_error handler is to die on an error.
  */
 int
 parse_config(const char *cf, LEX_ERROR_HANDLER *scan_error)
@@ -755,17 +757,18 @@ parse_config(const char *cf, LEX_ERROR_HANDLER *scan_error)
    for (pass=1; pass <= 2; pass++) {
       Dmsg1(900, "parse_config pass %d\n", pass);
       if ((lc = lex_open_file(lc, cf, scan_error)) == NULL) {
+         berrno be;
+         /* We must create a lex packet to print the error */
          lc = (LEX *)malloc(sizeof(LEX));
          memset(lc, 0, sizeof(LEX));
          if (scan_error) {
             lc->scan_error = scan_error;
          } else {
-            lc->scan_error = s_err;
+            lex_set_default_error_handler(lc);
          }
          bstrncpy(lc->str, cf, sizeof(lc->str));
          lc->fname = lc->str;
-         berrno be;
-         scan_err2(lc, _("Cannot open config file %s: %s\n"),
+         scan_err2(lc, _("Cannot open config file \"%s\": %s\n"),
             lc->str, be.strerror());
          free(lc);
          return 0;