提交 d16cbd53 authored 作者: Michael Jerris's avatar Michael Jerris

clean up error message handling in module loader process.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10412 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 0a198ddd
...@@ -870,7 +870,7 @@ static switch_status_t switch_loadable_module_load_module_ex(char *dir, char *fn ...@@ -870,7 +870,7 @@ static switch_status_t switch_loadable_module_load_module_ex(char *dir, char *fn
char *path; char *path;
char *file, *dot; char *file, *dot;
switch_loadable_module_t *new_module = NULL; switch_loadable_module_t *new_module = NULL;
switch_status_t status; switch_status_t status = SWITCH_STATUS_SUCCESS;
#ifdef WIN32 #ifdef WIN32
const char *ext = ".dll"; const char *ext = ".dll";
...@@ -878,8 +878,10 @@ static switch_status_t switch_loadable_module_load_module_ex(char *dir, char *fn ...@@ -878,8 +878,10 @@ static switch_status_t switch_loadable_module_load_module_ex(char *dir, char *fn
const char *ext = ".so"; const char *ext = ".so";
#endif #endif
*err = "";
if ((file = switch_core_strdup(loadable_modules.pool, fname)) == 0) { if ((file = switch_core_strdup(loadable_modules.pool, fname)) == 0) {
*err = "allocation error";
return SWITCH_STATUS_FALSE; return SWITCH_STATUS_FALSE;
} }
...@@ -910,7 +912,11 @@ static switch_status_t switch_loadable_module_load_module_ex(char *dir, char *fn ...@@ -910,7 +912,11 @@ static switch_status_t switch_loadable_module_load_module_ex(char *dir, char *fn
if (new_module->switch_module_runtime) { if (new_module->switch_module_runtime) {
switch_core_launch_thread(switch_loadable_module_exec, new_module, new_module->pool); switch_core_launch_thread(switch_loadable_module_exec, new_module, new_module->pool);
} }
} else if (status != SWITCH_STATUS_SUCCESS) {
*err = "module load routine returned an error";
} }
} else {
*err = "module load file routine returned an error";
} }
switch_mutex_unlock(loadable_modules.mutex); switch_mutex_unlock(loadable_modules.mutex);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论