Parcourir la source

mtree: avoid re-init of db handler

- applies for mi cmd usage with xmlrpc module
Daniel-Constantin Mierla il y a 15 ans
Parent
commit
6c1e441f8c
1 fichiers modifiés avec 3 ajouts et 3 suppressions
  1. 3 3
      modules/mtree/mtree_mod.c

+ 3 - 3
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)
 	{