Module: sip-router
Branch: janakj/mysql
Commit: 43f01015237b9fabd9ef36d9674aac5bababcb1e
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=43f0101…
Author: Jan Janak <jan(a)iptel.org>
Committer: Jan Janak <jan(a)iptel.org>
Date: Tue Feb 17 11:12:04 2009 +0100
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.
---
modules/db_mysql/km_db_mysql.c | 6 ++----
modules/db_mysql/km_db_mysql.h | 2 ++
modules/db_mysql/mysql_mod.c | 3 ++-
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/modules/db_mysql/km_db_mysql.c b/modules/db_mysql/km_db_mysql.c
index 5c564b1..eb0ca05 100644
--- a/modules/db_mysql/km_db_mysql.c
+++ b/modules/db_mysql/km_db_mysql.c
@@ -50,8 +50,6 @@
unsigned int db_mysql_timeout_interval = 2; /* Default is 6 seconds */
unsigned int db_mysql_auto_reconnect = 1; /* Default is enabled */
-static int mysql_mod_init(void);
-
/* MODULE_VERSION */
/*! \brief
@@ -81,14 +79,14 @@ struct kam_module_exports kam_exports = {
0, /* exported MI functions */
0, /* exported pseudo-variables */
0, /* extra processes */
- mysql_mod_init, /* module initialization function */
+ kam_mysql_mod_init, /* module initialization function */
0, /* response function*/
0, /* destroy function */
0 /* per-child init function */
};
-static int mysql_mod_init(void)
+int kam_mysql_mod_init(void)
{
LM_DBG("MySQL client version is %s\n", mysql_get_client_info());
return 0;
diff --git a/modules/db_mysql/km_db_mysql.h b/modules/db_mysql/km_db_mysql.h
index b0b475e..4705ca0 100644
--- a/modules/db_mysql/km_db_mysql.h
+++ b/modules/db_mysql/km_db_mysql.h
@@ -45,4 +45,6 @@ extern unsigned int db_mysql_auto_reconnect;
int db_mysql_bind_api(db_func_t *dbb);
+int kam_mysql_mod_init(void);
+
#endif /* KM_DB_MOD_H */
diff --git a/modules/db_mysql/mysql_mod.c b/modules/db_mysql/mysql_mod.c
index 61c2683..bfd903d 100644
--- a/modules/db_mysql/mysql_mod.c
+++ b/modules/db_mysql/mysql_mod.c
@@ -144,7 +144,8 @@ static int mysql_mod_init(void)
" compiled against %ld)\n", MYSQL_VERSION_ID);
}
#endif
- return 0;
+
+ return kam_mysql_mod_init();
}
/** @} */