瀏覽代碼

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
Daniel-Constantin Mierla 14 年之前
父節點
當前提交
b5754d49ce
共有 2 個文件被更改,包括 13 次插入0 次删除
  1. 4 0
      modules_k/mi_fifo/fifo_fnc.c
  2. 9 0
      modules_k/mi_fifo/mi_fifo.c

+ 4 - 0
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]' */

+ 9 - 0
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);
 		}
 	}