From bb14964dd8337d0946c7e233ff3cc81f22e8e1bb Mon Sep 17 00:00:00 2001 From: Daniel-Constantin Mierla Date: Fri, 22 Jun 2018 19:54:51 +0200 Subject: [PATCH] jsonrpcc: init and update cfg framework for io handler process - GH #1520 --- src/modules/jsonrpcc/jsonrpc_io.c | 4 ++++ src/modules/jsonrpcc/jsonrpcc_mod.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/src/modules/jsonrpcc/jsonrpc_io.c b/src/modules/jsonrpcc/jsonrpc_io.c index cae18322ba1..ebb93348ba3 100644 --- a/src/modules/jsonrpcc/jsonrpc_io.c +++ b/src/modules/jsonrpcc/jsonrpc_io.c @@ -33,6 +33,8 @@ #include "../../core/route.h" #include "../../core/route_struct.h" #include "../../core/lvalue.h" +#include "../../core/cfg/cfg_struct.h" + #include "../tm/tm_load.h" #include "jsonrpc_io.h" @@ -156,6 +158,8 @@ void cmd_pipe_cb(int fd, short event, void *arg) return; } + cfg_update(); + params = json_tokener_parse(cmd->params); if (cmd->notify_only) { diff --git a/src/modules/jsonrpcc/jsonrpcc_mod.c b/src/modules/jsonrpcc/jsonrpcc_mod.c index 903b2784472..2c3cce22db3 100644 --- a/src/modules/jsonrpcc/jsonrpcc_mod.c +++ b/src/modules/jsonrpcc/jsonrpcc_mod.c @@ -28,6 +28,8 @@ #include "../../core/mod_fix.h" #include "../../core/trim.h" #include "../../core/sr_module.h" +#include "../../core/cfg/cfg_struct.h" + #include "../tm/tm_load.h" #include "jsonrpc_request.h" @@ -139,6 +141,9 @@ static int child_init(int rank) if(pid==0){ /* child */ close(pipe_fds[1]); + /* initialize the config framework */ + if (cfg_child_init()) + return -1; return jsonrpc_io_child_process(pipe_fds[0], servers_param); } return 0;