Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
5337872c
提交
5337872c
authored
6月 05, 2006
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update
git-svn-id:
http://svn.freeswitch.org/svn/freeswitch/trunk@1545
d0543943-73ff-0310-b7d9-9358b9ac24b2
上级
e9563fbf
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
17 行增加
和
13 行删除
+17
-13
switch_core.h
src/include/switch_core.h
+2
-1
switch.c
src/switch.c
+3
-5
switch_core.c
src/switch_core.c
+12
-7
没有找到文件。
src/include/switch_core.h
浏览文件 @
5337872c
...
...
@@ -111,9 +111,10 @@ struct switch_core_runtime;
/*!
\brief Initilize the core
\param console optional FILE stream for output
\param a pointer to set any errors to
\note to be called at application startup
*/
SWITCH_DECLARE
(
switch_status_t
)
switch_core_init
(
char
*
console
);
SWITCH_DECLARE
(
switch_status_t
)
switch_core_init
(
char
*
console
,
const
char
**
err
);
/*!
\brief Destroy the core
...
...
src/switch.c
浏览文件 @
5337872c
...
...
@@ -70,7 +70,7 @@ int main(int argc, char *argv[])
char
*
pfile
=
"freeswitch.pid"
;
char
path
[
256
]
=
""
;
char
*
ppath
=
NULL
;
char
*
err
=
NULL
;
c
onst
c
har
*
err
=
NULL
;
switch_event_t
*
event
;
int
bg
=
0
;
FILE
*
f
;
...
...
@@ -124,8 +124,8 @@ int main(int argc, char *argv[])
}
if
(
switch_core_init
(
ppath
)
!=
SWITCH_STATUS_SUCCESS
)
{
fprintf
(
stderr
,
"Cannot Initilize
\n
"
);
if
(
switch_core_init
(
ppath
,
&
err
)
!=
SWITCH_STATUS_SUCCESS
)
{
fprintf
(
stderr
,
"Cannot Initilize
[%s]
\n
"
,
err
);
return
255
;
}
...
...
@@ -156,8 +156,6 @@ int main(int argc, char *argv[])
fprintf
(
f
,
"%d"
,
getpid
());
fclose
(
f
);
if
(
!
err
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_CONSOLE
,
"Bringing up environment.
\n
"
);
...
...
src/switch_core.c
浏览文件 @
5337872c
...
...
@@ -2758,9 +2758,8 @@ SWITCH_DECLARE(void) switch_core_set_globals(void)
#endif
}
SWITCH_DECLARE
(
switch_status_t
)
switch_core_init
(
char
*
console
)
SWITCH_DECLARE
(
switch_status_t
)
switch_core_init
(
char
*
console
,
const
char
**
err
)
{
const
char
*
err
=
NULL
;
memset
(
&
runtime
,
0
,
sizeof
(
runtime
));
switch_core_set_globals
();
...
...
@@ -2768,29 +2767,35 @@ SWITCH_DECLARE(switch_status_t) switch_core_init(char *console)
/* INIT APR and Create the pool context */
if
(
apr_initialize
()
!=
SWITCH_STATUS_SUCCESS
)
{
apr_terminate
();
fprintf
(
stderr
,
"FATAL ERROR! Could not initilize APR
\n
"
)
;
*
err
=
"FATAL ERROR! Could not initilize APR
\n
"
;
return
SWITCH_STATUS_MEMERR
;
}
if
(
apr_pool_create
(
&
runtime
.
memory_pool
,
NULL
)
!=
SWITCH_STATUS_SUCCESS
)
{
apr_terminate
();
fprintf
(
stderr
,
"FATAL ERROR! Could not allocate memory pool
\n
"
)
;
*
err
=
"FATAL ERROR! Could not allocate memory pool
\n
"
;
return
SWITCH_STATUS_MEMERR
;
}
if
(
switch_xml_init
(
runtime
.
memory_pool
,
&
err
)
!=
SWITCH_STATUS_SUCCESS
)
{
if
(
switch_xml_init
(
runtime
.
memory_pool
,
err
)
!=
SWITCH_STATUS_SUCCESS
)
{
apr_terminate
();
fprintf
(
stderr
,
"FATAL ERROR! Could not open XML Registry %s
\n
"
,
err
)
;
*
err
=
"FATAL ERROR! Could not open XML Registry %s
\n
"
;
return
SWITCH_STATUS_MEMERR
;
}
*
err
=
NULL
;
if
(
console
)
{
if
(
*
console
!=
'/'
)
{
char
path
[
265
];
snprintf
(
path
,
sizeof
(
path
),
"%s%s%s"
,
SWITCH_GLOBAL_dirs
.
log_dir
,
SWITCH_PATH_SEPARATOR
,
console
);
console
=
path
;
}
switch_core_set_console
(
console
);
if
(
switch_core_set_console
(
console
)
!=
SWITCH_STATUS_SUCCESS
)
{
*
err
=
"FATAL ERROR! Could not open console
\n
"
;
apr_terminate
();
return
SWITCH_STATUS_GENERR
;
}
}
else
{
runtime
.
console
=
stdout
;
}
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论