Module: kamailio
Branch: 5.8
Commit: 613e2cdfc3ae9242d259bf8b67b6ed715c0c0ad8
URL:
https://github.com/kamailio/kamailio/commit/613e2cdfc3ae9242d259bf8b67b6ed7…
Author: Xenofon Karamanos <22965395+xkaraman(a)users.noreply.github.com>
Committer: Xenofon Karamanos <22965395+xkaraman(a)users.noreply.github.com>
Date: 2024-03-28T16:05:48Z
file_out: FIx ������for������ loop initial declarations error
(cherry picked from commit ae04ccac92225a1e7b573a28ded555789e8604cd)
---
Modified: src/modules/file_out/file_out.c
---
Diff:
https://github.com/kamailio/kamailio/commit/613e2cdfc3ae9242d259bf8b67b6ed7…
Patch:
https://github.com/kamailio/kamailio/commit/613e2cdfc3ae9242d259bf8b67b6ed7…
---
diff --git a/src/modules/file_out/file_out.c b/src/modules/file_out/file_out.c
index 886f01f944f..a13d3531dde 100644
--- a/src/modules/file_out/file_out.c
+++ b/src/modules/file_out/file_out.c
@@ -100,6 +100,7 @@ struct module_exports exports = {
static int mod_init(void)
{
+ int i = 0;
LM_DBG("initializing\n");
LM_DBG("base_folder = %.*s\n", fo_base_folder.len, fo_base_folder.s);
@@ -121,7 +122,7 @@ static int mod_init(void)
*fo_number_of_files = fo_count_assigned_files();
/* Fixup the prefix */
- for(int i = 0; i < *fo_number_of_files; i++) {
+ for(i = 0; i < *fo_number_of_files; i++) {
str s;
s.s = fo_files[i].fo_prefix.s;
s.len = fo_files[i].fo_prefix.len;
@@ -139,7 +140,7 @@ static int mod_init(void)
}
/* Initialize per process vars */
- for(int i = 0; i < *fo_number_of_files; i++) {
+ for(i = 0; i < *fo_number_of_files; i++) {
fo_files[i].fo_stored_timestamp = time(NULL);
}
@@ -156,6 +157,7 @@ static int mod_init(void)
static int child_init(int rank)
{
int pid;
+ int i = 0;
if(rank != PROC_MAIN) {
return 0;
}
@@ -172,7 +174,7 @@ static int child_init(int rank)
return -1;
/* Initialize and open files */
- for(int i = 0; i < *fo_number_of_files; i++) {
+ for(i = 0; i < *fo_number_of_files; i++) {
fo_init_file(i);
}
@@ -194,7 +196,8 @@ static int child_init(int rank)
static void destroy(void)
{
int result = 0;
- for(int i = 0; i < *fo_number_of_files; i++) {
+ int i = 0;
+ for(i = 0; i < *fo_number_of_files; i++) {
result = fo_file_properties_destroy(&fo_files[i]);
if(result < 0) {
LM_ERR("Failed to destroy file properties\n");