Browse code

app_perl: continue on perl_parse() non-0 return code

- it is application return code on some perl versions

Daniel-Constantin Mierla authored on 07/07/2022 06:55:21
Showing 1 changed files
... ...
@@ -235,16 +235,12 @@ PerlInterpreter *parser_init(void) {
235 235
 	argc++;
236 236
 
237 237
 	pr=perl_parse(new_perl, xs_init, argc, argv, NULL);
238
+
238 239
 	if (pr) {
239
-		LM_ERR("failed to load perl file \"%s\" with code %d.\n", argv[argc-1], pr);
240
-		if (modpathset_start) {
241
-			for (i = modpathset_start; i <= modpathset_end; i++) {
242
-				pkg_free(argv[i]);
243
-			}
244
-		}
245
-		return NULL;
240
+		LM_WARN("parsed perl file \"%s\" returned with code %d - continue\n",
241
+				argv[argc-1], pr);
246 242
 	} else {
247
-		LM_INFO("successfully loaded perl file \"%s\"\n", argv[argc-1]);
243
+		LM_INFO("successfully parsed perl file \"%s\"\n", argv[argc-1]);
248 244
 	}
249 245
 
250 246
 	if (modpathset_start) {
... ...
@@ -252,7 +248,8 @@ PerlInterpreter *parser_init(void) {
252 248
 			pkg_free(argv[i]);
253 249
 		}
254 250
 	}
255
-	perl_run(new_perl);
251
+	pr = perl_run(new_perl);
252
+	LM_INFO("perl run return code %d\n", pr);
256 253
 
257 254
 	return new_perl;
258 255