Browse code

Make sure mod_init from kamailio/db_mysql is called.

Changes include:
* mysql_mod_init renamed to kam_mysql_mod_init to avoid conflicts
with sources from ser
* The function is no longer static so that it can be accessed from
mysql_mod.c
* mysql_mod_init modified to call kam_mysql_mod_init at the end.

Jan Janak authored on 17/02/2009 10:12:04
Showing 3 changed files
... ...
@@ -50,8 +50,6 @@
50 50
 unsigned int db_mysql_timeout_interval = 2;   /* Default is 6 seconds */
51 51
 unsigned int db_mysql_auto_reconnect = 1;     /* Default is enabled   */
52 52
 
53
-static int mysql_mod_init(void);
54
-
55 53
 /* MODULE_VERSION */
56 54
 
57 55
 /*! \brief
... ...
@@ -81,14 +79,14 @@ struct kam_module_exports kam_exports = {
81 79
 	0,               /* exported MI functions */
82 80
 	0,               /* exported pseudo-variables */
83 81
 	0,               /* extra processes */
84
-	mysql_mod_init,  /* module initialization function */
82
+	kam_mysql_mod_init,  /* module initialization function */
85 83
 	0,               /* response function*/
86 84
 	0,               /* destroy function */
87 85
 	0                /* per-child init function */
88 86
 };
89 87
 
90 88
 
91
-static int mysql_mod_init(void)
89
+int kam_mysql_mod_init(void)
92 90
 {
93 91
 	LM_DBG("MySQL client version is %s\n", mysql_get_client_info());
94 92
 	return 0;
... ...
@@ -45,4 +45,6 @@ extern unsigned int db_mysql_auto_reconnect;
45 45
 
46 46
 int db_mysql_bind_api(db_func_t *dbb);
47 47
 
48
+int kam_mysql_mod_init(void);
49
+
48 50
 #endif /* KM_DB_MOD_H */
... ...
@@ -144,7 +144,8 @@ static int mysql_mod_init(void)
144 144
 			" compiled against %ld)\n", MYSQL_VERSION_ID);
145 145
 	}
146 146
 #endif
147
-	return 0;
147
+
148
+	return kam_mysql_mod_init();
148 149
 }
149 150
 
150 151
 /** @} */