浏览代码

app_perl: new parameter to set warn flag for perl parse

Daniel-Constantin Mierla 3 年之前
父节点
当前提交
ec78caf6e0
共有 1 个文件被更改,包括 7 次插入1 次删除
  1. 7 1
      src/modules/app_perl/app_perl_mod.c

+ 7 - 1
src/modules/app_perl/app_perl_mod.c

@@ -72,6 +72,7 @@ int _ap_reset_cycles_init = 0;
 int _ap_exec_cycles = 0;
 int _ap_exec_cycles = 0;
 int *_ap_reset_cycles = 0;
 int *_ap_reset_cycles = 0;
 int _ap_parse_mode = 0;
 int _ap_parse_mode = 0;
+static int _ap_warn_mode = 0;
 
 
 /* Reference to the running Perl interpreter instance */
 /* Reference to the running Perl interpreter instance */
 PerlInterpreter *my_perl = NULL;
 PerlInterpreter *my_perl = NULL;
@@ -125,6 +126,7 @@ static param_export_t params[] = {
 	{"reset_cycles", INT_PARAM, &_ap_reset_cycles_init},
 	{"reset_cycles", INT_PARAM, &_ap_reset_cycles_init},
 	{"perl_destroy_func",  PARAM_STRING, &perl_destroy_func},
 	{"perl_destroy_func",  PARAM_STRING, &perl_destroy_func},
 	{"parse_mode", PARAM_INT, &_ap_parse_mode},
 	{"parse_mode", PARAM_INT, &_ap_parse_mode},
+	{"warn_mode",  PARAM_INT, &_ap_warn_mode},
 	{ 0, 0, 0 }
 	{ 0, 0, 0 }
 };
 };
 
 
@@ -185,7 +187,7 @@ EXTERN_C void xs_init(pTHX) {
  */
  */
 int parser_init(void) {
 int parser_init(void) {
 	int argc = 0;
 	int argc = 0;
-	char *argv[MAX_LIB_PATHS + 3];
+	char *argv[MAX_LIB_PATHS + 6];
 	char *entry, *stop, *end;
 	char *entry, *stop, *end;
 	int modpathset_start = 0;
 	int modpathset_start = 0;
 	int modpathset_end = 0;
 	int modpathset_end = 0;
@@ -208,6 +210,10 @@ int parser_init(void) {
 
 
 	argv[0] = ""; argc++; /* First param _needs_ to be empty */
 	argv[0] = ""; argc++; /* First param _needs_ to be empty */
 
 
+	if(_ap_warn_mode==1) {
+		argv[argc] = "-w"; argc++;
+	}
+
 	 /* Possible Include path extension by modparam */
 	 /* Possible Include path extension by modparam */
 	if (modpath && (strlen(modpath) > 0)) {
 	if (modpath && (strlen(modpath) > 0)) {
 		modpathset_start = argc;
 		modpathset_start = argc;