[sr-dev] git:3.1: mi_fifo: update the config framework structures in fifo process

Daniel-Constantin Mierla miconda at gmail.com
Thu Apr 7 19:07:03 CEST 2011


Module: sip-router
Branch: 3.1
Commit: 6452fc57d09792245dfc12f84c8c294bb7789b23
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6452fc57d09792245dfc12f84c8c294bb7789b23

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Thu Apr  7 19:02:15 2011 +0200

mi_fifo: update the config framework structures in fifo process

- the extra process created by mi_fifo to listen on fifo file was not
  registered for updating the config framework structures
- reported by Klaus Darilion
- credits to Miklos Tirpak for hints to do it
(cherry picked from commit b5754d49ce59d659f641e5892f763208401ce8d2)

---

 modules_k/mi_fifo/fifo_fnc.c |    4 ++++
 modules_k/mi_fifo/mi_fifo.c  |    9 +++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/modules_k/mi_fifo/fifo_fnc.c b/modules_k/mi_fifo/fifo_fnc.c
index 6284590..5f0d07d 100644
--- a/modules_k/mi_fifo/fifo_fnc.c
+++ b/modules_k/mi_fifo/fifo_fnc.c
@@ -47,6 +47,7 @@
 #include "../../lib/kmi/mi.h"
 #include "../../mem/mem.h"
 #include "../../mem/shm_mem.h"
+#include "../../cfg/cfg_struct.h"
 #include "mi_fifo.h"
 #include "fifo_fnc.h"
 #include "mi_parser.h"
@@ -409,6 +410,9 @@ void mi_fifo_server(FILE *fifo_stream)
 	FILE *reply_stream;
 
 	while(1) {
+		/* update the local config framework structures */
+		cfg_update();
+
 		reply_stream = NULL;
 
 		/* commands must look this way ':<command>:[filename]' */
diff --git a/modules_k/mi_fifo/mi_fifo.c b/modules_k/mi_fifo/mi_fifo.c
index 17a72b8..9530c4c 100644
--- a/modules_k/mi_fifo/mi_fifo.c
+++ b/modules_k/mi_fifo/mi_fifo.c
@@ -46,6 +46,7 @@
 #include "../../pt.h"
 #include "../../mem/mem.h"
 #include "../../mem/shm_mem.h"
+#include "../../cfg/cfg_struct.h"
 #include "../../lib/kmi/mi.h"
 #include "mi_fifo.h"
 #include "mi_parser.h"
@@ -174,6 +175,9 @@ static int mi_mod_init(void)
 	/* add space for one extra process */
 	register_procs(1);
 
+	/* add child to update local config framework structures */
+	cfg_register_child(1);
+
 	return 0;
 }
 
@@ -196,6 +200,11 @@ static int mi_child_init(int rank)
 			return -1; /* error */
 		if(pid==0){
 			/* child */
+
+			/* initialize the config framework */
+			if (cfg_child_init())
+				return -1;
+
 			fifo_process(1);
 		}
 	}




More information about the sr-dev mailing list