(cherry picked from commit 2e38d1a5a1178ca437d5256d7619fee251b06d6f)
... | ... |
@@ -318,18 +318,6 @@ error1: |
318 | 318 |
return -1; |
319 | 319 |
} |
320 | 320 |
|
321 |
-static int mt_child_init(void) |
|
322 |
-{ |
|
323 |
- db_con = mt_dbf.init(&db_url); |
|
324 |
- if(db_con==NULL) |
|
325 |
- { |
|
326 |
- LM_ERR("failed to connect to database\n"); |
|
327 |
- return -1; |
|
328 |
- } |
|
329 |
- |
|
330 |
- return 0; |
|
331 |
-} |
|
332 |
- |
|
333 | 321 |
|
334 | 322 |
/* each child get a new connection to the database */ |
335 | 323 |
static int child_init(int rank) |
... | ... |
@@ -338,9 +326,12 @@ static int child_init(int rank) |
338 | 326 |
if (rank==PROC_INIT || rank==PROC_MAIN || rank==PROC_TCP_MAIN) |
339 | 327 |
return 0; |
340 | 328 |
|
341 |
- if ( mt_child_init()!=0 ) |
|
329 |
+ db_con = mt_dbf.init(&db_url); |
|
330 |
+ if(db_con==NULL) |
|
331 |
+ { |
|
332 |
+ LM_ERR("failed to connect to database\n"); |
|
342 | 333 |
return -1; |
343 |
- |
|
334 |
+ } |
|
344 | 335 |
LM_DBG("#%d: database connection opened successfully\n", rank); |
345 | 336 |
|
346 | 337 |
return 0; |
... | ... |
@@ -942,7 +933,7 @@ void rpc_mtree_reload(rpc_t* rpc, void* c) |
942 | 933 |
} |
943 | 934 |
rpc->rpl_printf(c, "Ok. Mtrees reloaded."); |
944 | 935 |
return; |
945 |
- } |
|
936 |
+ } |
|
946 | 937 |
if(!mt_defined_trees()) |
947 | 938 |
{ |
948 | 939 |
rpc->fault(c, 500, "No Mtrees defined."); |