]> git.ipfire.org Git - thirdparty/bacula.git/commitdiff
Fix #6454 About bconsole complaining when dynamic configuration generates messages...
authorEric Bollengier <eric@baculasystems.com>
Fri, 26 Jun 2020 09:30:52 +0000 (11:30 +0200)
committerEric Bollengier <eric@baculasystems.com>
Tue, 1 Mar 2022 14:36:16 +0000 (15:36 +0100)
bacula/src/lib/lex.c

index ded6dd9ec9409138fd7068bc673fa9ed893c6cd5..b58a7973855f2a60aacd0e02033cd5af679442cf 100644 (file)
@@ -240,10 +240,11 @@ LEX *lex_open_file(LEX *lf, const char *filename, LEX_ERROR_HANDLER *scan_error)
    char *fname = bstrdup(filename);
 
    if (fname[0] == '|') {
-      if ((bpipe = open_bpipe(fname+1, 0, "rb")) == NULL) {
+      if ((bpipe = open_bpipe(fname+1, 0, "reb")) == NULL) {
          free(fname);
          return NULL;
       }
+      close_epipe(bpipe);       /* discard stderr messages */
       fd = bpipe->rfd;
    } else if ((fd = fopen(fname, "rb")) == NULL) {
       free(fname);