[sr-dev] git:master:3b31c51b: jsonrpc-c: set the cpm pipe for all child processes

Daniel-Constantin Mierla miconda at gmail.com
Mon Sep 12 17:32:56 CEST 2016


Module: kamailio
Branch: master
Commit: 3b31c51bd66737891b549895dea068494929926c
URL: https://github.com/kamailio/kamailio/commit/3b31c51bd66737891b549895dea068494929926c

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2016-09-12T17:31:36+02:00

jsonrpc-c: set the cpm pipe for all child processes

- reported by Ian Yu-Hsun Lin, GH #713

---

Modified: modules/jsonrpc-c/jsonrpc_mod.c

---

Diff:  https://github.com/kamailio/kamailio/commit/3b31c51bd66737891b549895dea068494929926c.diff
Patch: https://github.com/kamailio/kamailio/commit/3b31c51bd66737891b549895dea068494929926c.patch

---

diff --git a/modules/jsonrpc-c/jsonrpc_mod.c b/modules/jsonrpc-c/jsonrpc_mod.c
index f462a14..39d8819 100644
--- a/modules/jsonrpc-c/jsonrpc_mod.c
+++ b/modules/jsonrpc-c/jsonrpc_mod.c
@@ -115,15 +115,15 @@ static int mod_init(void) {
 		LM_ERR("pipe() failed\n");
 		return -1;
 	}
-	
+
 	return(0);
 }
 
-static int child_init(int rank) 
+static int child_init(int rank)
 {
 	int pid;
-	
-	if (rank>PROC_MAIN)
+
+	if (rank!=PROC_INIT)
 		cmd_pipe = pipe_fds[1];
 
 	if (rank!=PROC_MAIN)




More information about the sr-dev mailing list