Browse Source

cfg.y : improved printing of error messages to stderr

The -E was ignored during the yyparse() stage, if log_stderr=no parameter in the cfg was set (default config)
This caused problems debugging certain lodmodule errors.
Marius Zbihlei 13 years ago
parent
commit
9d5ef9925d
1 changed files with 3 additions and 1 deletions
  1. 3 1
      cfg.y

+ 3 - 1
cfg.y

@@ -853,7 +853,9 @@ assign_stm:
 	| FORK  EQUAL error  { yyerror("boolean value expected"); }
 	| FORK  EQUAL error  { yyerror("boolean value expected"); }
 	| FORK_DELAY  EQUAL NUMBER { set_fork_delay($3); }
 	| FORK_DELAY  EQUAL NUMBER { set_fork_delay($3); }
 	| FORK_DELAY  EQUAL error  { yyerror("number expected"); }
 	| FORK_DELAY  EQUAL error  { yyerror("number expected"); }
-	| LOGSTDERROR EQUAL NUMBER { if (!config_check) log_stderr=$3; }
+	| LOGSTDERROR EQUAL NUMBER { if (!config_check)  /* if set from cmd line, don't overwrite from yyparse()*/ 
+					if(log_stderr == 0) log_stderr=$3; 
+				   }
 	| LOGSTDERROR EQUAL error { yyerror("boolean value expected"); }
 	| LOGSTDERROR EQUAL error { yyerror("boolean value expected"); }
 	| LOGFACILITY EQUAL ID {
 	| LOGFACILITY EQUAL ID {
 		if ( (i_tmp=str2facility($3))==-1)
 		if ( (i_tmp=str2facility($3))==-1)