Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
0f6a2bf8
提交
0f6a2bf8
authored
12月 20, 2011
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
the threaded one seems to not work using only fork
上级
6824871d
隐藏空白字符变更
内嵌
并排
正在显示
3 个修改的文件
包含
23 行增加
和
11 行删除
+23
-11
switch_core.h
src/include/switch_core.h
+1
-1
switch_core.c
src/switch_core.c
+21
-9
switch_xml.c
src/switch_xml.c
+1
-1
没有找到文件。
src/include/switch_core.h
浏览文件 @
0f6a2bf8
...
...
@@ -2304,7 +2304,7 @@ SWITCH_DECLARE(void) switch_say_file_handle_destroy(switch_say_file_handle_t **s
SWITCH_DECLARE
(
switch_status_t
)
switch_say_file_handle_create
(
switch_say_file_handle_t
**
sh
,
const
char
*
ext
,
switch_event_t
**
var_event
);
SWITCH_DECLARE
(
void
)
switch_say_file
(
switch_say_file_handle_t
*
sh
,
const
char
*
fmt
,
...);
SWITCH_DECLARE
(
int
)
switch_max_file_desc
(
void
);
SWITCH_DECLARE
(
void
)
switch_close_extra_files
(
void
);
SWITCH_DECLARE
(
void
)
switch_close_extra_files
(
int
*
keep
,
int
keep_ttl
);
SWITCH_END_EXTERN_C
#endif
...
...
src/switch_core.c
浏览文件 @
0f6a2bf8
...
...
@@ -2421,13 +2421,26 @@ SWITCH_DECLARE(int) switch_max_file_desc(void)
}
SWITCH_DECLARE
(
void
)
switch_close_extra_files
(
void
)
SWITCH_DECLARE
(
void
)
switch_close_extra_files
(
int
*
keep
,
int
keep_ttl
)
{
int
open_max
=
switch_max_file_desc
();
int
i
;
int
i
,
j
;
for
(
i
=
3
;
i
<
open_max
;
i
++
)
{
if
(
keep
)
{
for
(
j
=
0
;
j
<
keep_ttl
;
j
++
)
{
if
(
i
==
keep
[
j
])
{
goto
skip
;
}
}
}
close
(
i
);
skip
:
continue
;
}
}
...
...
@@ -2456,7 +2469,7 @@ static int switch_system_fork(const char *cmd, switch_bool_t wait)
}
free
(
dcmd
);
}
else
{
switch_close_extra_files
();
switch_close_extra_files
(
NULL
,
0
);
set_low_priority
();
system
(
dcmd
);
...
...
@@ -2508,7 +2521,7 @@ SWITCH_DECLARE(int) switch_stream_system_fork(const char *cmd, switch_stream_han
close
(
fds
[
0
]);
waitpid
(
pid
,
NULL
,
0
);
}
else
{
/* child */
switch_close_extra_files
();
switch_close_extra_files
(
fds
,
2
);
close
(
fds
[
0
]);
dup2
(
fds
[
1
],
STDOUT_FILENO
);
switch_system
(
cmd
,
SWITCH_TRUE
);
...
...
@@ -2525,6 +2538,7 @@ SWITCH_DECLARE(int) switch_stream_system_fork(const char *cmd, switch_stream_han
}
<<<<<<<
HEAD
#ifndef WIN32
static
int
switch_stream_system_thread
(
const
char
*
cmd
,
switch_stream_handle_t
*
stream
)
{
...
...
@@ -2584,17 +2598,15 @@ static int switch_stream_system_thread(const char *cmd, switch_stream_handle_t *
}
#endif
=======
>>>>>>>
the
threaded
one
seems
to
not
work
using
only
fork
SWITCH_DECLARE
(
int
)
switch_stream_system
(
const
char
*
cmd
,
switch_stream_handle_t
*
stream
)
{
#ifdef WIN32
stream
->
write_function
(
stream
,
"Capturing output not supported.
\n
"
);
return
switch_system
(
cmd
,
SWITCH_TRUE
);
#else
int
(
*
sys_p
)(
const
char
*
cmd
,
switch_stream_handle_t
*
stream
);
sys_p
=
switch_test_flag
((
&
runtime
),
SCF_THREADED_SYSTEM_EXEC
)
?
switch_stream_system_thread
:
switch_stream_system_fork
;
return
sys_p
(
cmd
,
stream
);
return
switch_stream_system_fork
(
cmd
,
stream
);
#endif
}
...
...
src/switch_xml.c
浏览文件 @
0f6a2bf8
...
...
@@ -1256,7 +1256,7 @@ static int preprocess_exec(const char *cwd, const char *command, int write_fd, i
close
(
fds
[
0
]);
waitpid
(
pid
,
NULL
,
0
);
}
else
{
/* child */
switch_close_extra_files
();
switch_close_extra_files
(
fds
,
2
);
close
(
fds
[
0
]);
dup2
(
fds
[
1
],
STDOUT_FILENO
);
switch_system
(
command
,
SWITCH_TRUE
);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论