[sr-dev] git:master: mtree: avoid re-init of db handler

Daniel-Constantin Mierla miconda at gmail.com
Thu Jul 1 19:21:40 CEST 2010


Module: sip-router
Branch: master
Commit: 6c1e441f8c137503e3edd0a92d9bec5a7bd11379
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=6c1e441f8c137503e3edd0a92d9bec5a7bd11379

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date:   Thu Jul  1 19:13:46 2010 +0200

mtree: avoid re-init of db handler

- applies for mi cmd usage with xmlrpc module

---

 modules/mtree/mtree_mod.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/modules/mtree/mtree_mod.c b/modules/mtree/mtree_mod.c
index 23e06a1..2ab5ae5 100644
--- a/modules/mtree/mtree_mod.c
+++ b/modules/mtree/mtree_mod.c
@@ -313,16 +313,16 @@ error1:
 	mt_destroy_trees();
 
 	if(db_con!=NULL)
-	{
 		mt_dbf.close(db_con);
-		db_con = 0;
-	}
+	db_con = 0;
 	return -1;
 }
 
 
 static int child_init(void)
 {
+	if(db_con!=NULL)
+		return 0;
 	db_con = mt_dbf.init(&db_url);
 	if(db_con==NULL)
 	{




More information about the sr-dev mailing list