Module: sip-router
Branch: master
Commit: b5754d49ce59d659f641e5892f763208401ce8d2
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=b5754d4…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)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
---
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);
}
}