mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-01 19:43:03 +00:00
prevent deadlock if no config file
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1889 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -241,7 +241,7 @@ static int odbc_unload_module(void)
|
|||||||
|
|
||||||
static int odbc_load_module(void)
|
static int odbc_load_module(void)
|
||||||
{
|
{
|
||||||
int res;
|
int res = 0;
|
||||||
struct ast_config *cfg;
|
struct ast_config *cfg;
|
||||||
struct ast_variable *var;
|
struct ast_variable *var;
|
||||||
char *tmp;
|
char *tmp;
|
||||||
@@ -252,13 +252,13 @@ static int odbc_load_module(void)
|
|||||||
if (!cfg)
|
if (!cfg)
|
||||||
{
|
{
|
||||||
ast_log(LOG_WARNING, "cdr_odbc: Unable to load config for ODBC CDR's: %s\n", config);
|
ast_log(LOG_WARNING, "cdr_odbc: Unable to load config for ODBC CDR's: %s\n", config);
|
||||||
return 0;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
var = ast_variable_browse(cfg, "global");
|
var = ast_variable_browse(cfg, "global");
|
||||||
if (!var) {
|
if (!var) {
|
||||||
/* nothing configured */
|
/* nothing configured */
|
||||||
return 0;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp = ast_variable_retrieve(cfg,"global","dsn");
|
tmp = ast_variable_retrieve(cfg,"global","dsn");
|
||||||
@@ -368,6 +368,7 @@ static int odbc_load_module(void)
|
|||||||
{
|
{
|
||||||
ast_log(LOG_ERROR, "cdr_odbc: Unable to register ODBC CDR handling\n");
|
ast_log(LOG_ERROR, "cdr_odbc: Unable to register ODBC CDR handling\n");
|
||||||
}
|
}
|
||||||
|
out:
|
||||||
ast_mutex_unlock(&odbc_lock);
|
ast_mutex_unlock(&odbc_lock);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user