Просмотр исходного кода

mtree: avoid re-init of db handler

- applies for mi cmd usage with xmlrpc module
Daniel-Constantin Mierla 15 лет назад
Родитель
Сommit
6c1e441f8c
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      modules/mtree/mtree_mod.c

+ 3 - 3
modules/mtree/mtree_mod.c

@@ -313,16 +313,16 @@ error1:
 	mt_destroy_trees();
 	mt_destroy_trees();
 
 
 	if(db_con!=NULL)
 	if(db_con!=NULL)
-	{
 		mt_dbf.close(db_con);
 		mt_dbf.close(db_con);
-		db_con = 0;
-	}
+	db_con = 0;
 	return -1;
 	return -1;
 }
 }
 
 
 
 
 static int child_init(void)
 static int child_init(void)
 {
 {
+	if(db_con!=NULL)
+		return 0;
 	db_con = mt_dbf.init(&db_url);
 	db_con = mt_dbf.init(&db_url);
 	if(db_con==NULL)
 	if(db_con==NULL)
 	{
 	{