提交 3a003833 authored 作者: Michael Jerris's avatar Michael Jerris

add perl dir to the path at runtime on windows.

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@759 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 818991e5
......@@ -64,6 +64,7 @@ extern "C" {
#define APR_WANT_STDIO
#define APR_WANT_STRFUNC
#include <apr_want.h>
#include <apr_env.h>
/*
The pieces of apr we allow ppl to pass around between modules we typedef into our namespace and wrap all the functions
......
......@@ -29,7 +29,7 @@
* switch_loadable_module.c -- Loadable Modules
*
*/
#include <switch_console.h>
#include <switch.h>
struct switch_loadable_module {
......@@ -310,6 +310,24 @@ static void process_module_file(char *dir, char *fname)
}
}
#ifdef WIN32
static void switch_loadable_module_path_init()
{
char *path =NULL, *working =NULL;
apr_dir_t *perl_dir_handle = NULL;
apr_env_get(&path, "path", loadable_modules.pool);
apr_filepath_get(&working, APR_FILEPATH_NATIVE , loadable_modules.pool);
if (apr_dir_open(&perl_dir_handle, ".\\perl", loadable_modules.pool) == APR_SUCCESS) {
apr_dir_close(perl_dir_handle);
apr_env_set("path",
apr_pstrcat(loadable_modules.pool, path, ";", working, "\\perl", NULL),
loadable_modules.pool);
}
}
#endif
SWITCH_DECLARE(switch_status) switch_loadable_module_init()
{
......@@ -338,6 +356,10 @@ SWITCH_DECLARE(switch_status) switch_loadable_module_init()
switch_core_new_memory_pool(&loadable_modules.pool);
#ifdef WIN32
switch_loadable_module_path_init();
#endif
switch_core_hash_init(&loadable_modules.module_hash, loadable_modules.pool);
switch_core_hash_init(&loadable_modules.endpoint_hash, loadable_modules.pool);
switch_core_hash_init(&loadable_modules.codec_hash, loadable_modules.pool);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论