提交 f32a3a42 authored 作者: Anthony Minessale's avatar Anthony Minessale

fix unload

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5213 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 d10082c2
...@@ -785,7 +785,6 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_load_module(char *dir, ch ...@@ -785,7 +785,6 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_load_module(char *dir, ch
SWITCH_DECLARE(switch_status_t) switch_loadable_module_unload_module(char *dir, char *fname, const char **err) SWITCH_DECLARE(switch_status_t) switch_loadable_module_unload_module(char *dir, char *fname, const char **err)
{ {
switch_size_t len = 0;
char *path = NULL; char *path = NULL;
char *file = NULL; char *file = NULL;
switch_loadable_module_t *module = NULL; switch_loadable_module_t *module = NULL;
...@@ -808,17 +807,9 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_unload_module(char *dir, ...@@ -808,17 +807,9 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_unload_module(char *dir,
path = strdup(file); path = strdup(file);
} else { } else {
if (strchr(file, '.')) { if (strchr(file, '.')) {
len = strlen(dir); path = switch_mprintf("%s%s%s", dir, SWITCH_PATH_SEPARATOR, file);
len += strlen(file);
len += 4;
path = (char *) switch_core_alloc(loadable_modules.pool, len);
snprintf(path, len, "%s%s%s", dir, SWITCH_PATH_SEPARATOR, file);
} else { } else {
len = strlen(dir); path = switch_mprintf("%s%s%s%s", dir, SWITCH_PATH_SEPARATOR, file, ext);
len += strlen(file);
len += 8;
path = (char *) malloc(len);
snprintf(path, len, "%s%s%s%s", dir, SWITCH_PATH_SEPARATOR, file, ext);
} }
} }
...@@ -833,6 +824,7 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_unload_module(char *dir, ...@@ -833,6 +824,7 @@ SWITCH_DECLARE(switch_status_t) switch_loadable_module_unload_module(char *dir,
do_shutdown(module); do_shutdown(module);
} }
} else { } else {
*err = "No such module!";
status = SWITCH_STATUS_FALSE; status = SWITCH_STATUS_FALSE;
} }
switch_mutex_unlock(loadable_modules.mutex); switch_mutex_unlock(loadable_modules.mutex);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论