Skip to content
项目
群组
代码片段
帮助
正在加载...
登录
切换导航
F
freeswitch
项目
项目
详情
活动
周期分析
仓库
仓库
文件
提交
分支
标签
贡献者
分枝图
比较
统计图
议题
0
议题
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
CI / CD
CI / CD
流水线
作业
日程
统计图
Wiki
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
分枝图
统计图
创建新议题
作业
提交
议题看板
打开侧边栏
张华
freeswitch
Commits
52eff945
提交
52eff945
authored
10月 01, 2012
作者:
Anthony Minessale
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
wrap fork so we can drop priority in child processes
上级
0995d133
隐藏空白字符变更
内嵌
并排
正在显示
8 个修改的文件
包含
31 行增加
和
11 行删除
+31
-11
switch_core.h
src/include/switch_core.h
+3
-0
celliax_additional.c
src/mod/endpoints/mod_gsmopen/asterisk/celliax_additional.c
+2
-2
gsmopen_protocol.cpp
src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp
+1
-1
mod_shell_stream.c
src/mod/formats/mod_shell_stream/mod_shell_stream.c
+1
-1
xml_scgi_server.pl
src/mod/xml_int/mod_xml_scgi/xml_scgi_server.pl
+1
-1
switch.c
src/switch.c
+1
-1
switch_core.c
src/switch_core.c
+21
-4
switch_xml.c
src/switch_xml.c
+1
-1
没有找到文件。
src/include/switch_core.h
浏览文件 @
52eff945
...
...
@@ -2368,6 +2368,9 @@ SWITCH_DECLARE(void) switch_core_recovery_untrack(switch_core_session_t *session
SWITCH_DECLARE
(
void
)
switch_core_recovery_track
(
switch_core_session_t
*
session
);
SWITCH_DECLARE
(
void
)
switch_core_recovery_flush
(
const
char
*
technology
,
const
char
*
profile_name
);
SWITCH_DECLARE
(
pid_t
)
switch_fork
(
void
);
SWITCH_END_EXTERN_C
#endif
/* For Emacs:
...
...
src/mod/endpoints/mod_gsmopen/asterisk/celliax_additional.c
浏览文件 @
52eff945
...
...
@@ -1185,7 +1185,7 @@ int celliax_serial_getstatus_AT(struct celliax_pvt *p)
NOTICA
(
"incoming SMS message:>>>%s<<<
\n
"
,
CELLIAX_P_LOG
,
p
->
sms_message
);
pipe
(
fd1
);
pid1
=
fork
();
pid1
=
switch_
fork
();
if
(
pid1
==
0
)
{
//child
int
err
;
...
...
@@ -1735,7 +1735,7 @@ int celliax_serial_read_AT(struct celliax_pvt *p, int look_for_ack, int timeout_
NOTICA
(
"incoming SMS message:>>>%s<<<
\n
"
,
CELLIAX_P_LOG
,
p
->
sms_message
);
pipe
(
fd1
);
pid1
=
fork
();
pid1
=
switch_
fork
();
if
(
pid1
==
0
)
{
//child
int
err
;
...
...
src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp
浏览文件 @
52eff945
...
...
@@ -3101,7 +3101,7 @@ int gsmopen_serial_getstatus_AT(private_t *tech_pvt)
DEBUGA_AT("incoming SMS message:---%s---\n", GSMOPEN_P_LOG, p->sms_message);
pipe(fd1);
pid1 = fork();
pid1 =
switch_
fork();
if (pid1 == 0) { //child
int err;
...
...
src/mod/formats/mod_shell_stream/mod_shell_stream.c
浏览文件 @
52eff945
...
...
@@ -108,7 +108,7 @@ static switch_status_t shell_stream_file_open(switch_file_handle_t *handle, cons
if
(
pipe
(
context
->
fds
))
{
goto
error
;
}
else
{
/* good to go */
context
->
pid
=
fork
();
context
->
pid
=
switch_
fork
();
if
(
context
->
pid
<
0
)
{
/* ok maybe not */
goto
error
;
...
...
src/mod/xml_int/mod_xml_scgi/xml_scgi_server.pl
浏览文件 @
52eff945
...
...
@@ -65,7 +65,7 @@ $SIG{CHLD} = "IGNORE";
while
(
my
$request
=
$scgi
->
accept
)
{
# fork every new req into its own process (optional)
my
$pid
=
fork
();
my
$pid
=
switch_
fork
();
if
(
$pid
)
{
$request
->
close
();
...
...
src/switch.c
浏览文件 @
52eff945
...
...
@@ -262,7 +262,7 @@ static void daemonize(int do_wait)
}
}
pid
=
fork
();
pid
=
switch_
fork
();
switch
(
pid
)
{
case
0
:
/* child process */
...
...
src/switch_core.c
浏览文件 @
52eff945
...
...
@@ -2731,15 +2731,33 @@ SWITCH_DECLARE(void) switch_close_extra_files(int *keep, int keep_ttl)
}
#ifdef WIN32
static
int
switch_system_fork
(
const
char
*
cmd
,
switch_bool_t
wait
)
{
return
switch_system_thread
(
cmd
,
wait
);
}
SWITCH_DECLARE
(
pid_t
)
switch_fork
(
void
)
{
return
-
1
;
}
#else
SWITCH_DECLARE
(
pid_t
)
switch_fork
(
void
)
{
int
i
=
fork
();
if
(
!
i
)
{
set_low_priority
();
}
return
i
;
}
static
int
switch_system_fork
(
const
char
*
cmd
,
switch_bool_t
wait
)
{
int
pid
;
...
...
@@ -2747,7 +2765,7 @@ static int switch_system_fork(const char *cmd, switch_bool_t wait)
switch_core_set_signal_handlers
();
pid
=
fork
();
pid
=
switch_
fork
();
if
(
pid
)
{
if
(
wait
)
{
...
...
@@ -2757,7 +2775,6 @@ static int switch_system_fork(const char *cmd, switch_bool_t wait)
}
else
{
switch_close_extra_files
(
NULL
,
0
);
set_low_priority
();
if
(
system
(
dcmd
)
==
-
1
)
{
switch_log_printf
(
SWITCH_CHANNEL_LOG
,
SWITCH_LOG_ERROR
,
"Failed to execute because of a command error : %s
\n
"
,
dcmd
);
}
...
...
@@ -2793,7 +2810,7 @@ SWITCH_DECLARE(int) switch_stream_system_fork(const char *cmd, switch_stream_han
if
(
pipe
(
fds
))
{
goto
end
;
}
else
{
/* good to go */
pid
=
fork
();
pid
=
switch_
fork
();
if
(
pid
<
0
)
{
/* ok maybe not */
close
(
fds
[
0
]);
...
...
src/switch_xml.c
浏览文件 @
52eff945
...
...
@@ -1238,7 +1238,7 @@ static FILE *preprocess_exec(const char *cwd, const char *command, FILE *write_f
if
(
pipe
(
fds
))
{
goto
end
;
}
else
{
/* good to go */
pid
=
fork
();
pid
=
switch_
fork
();
if
(
pid
<
0
)
{
/* ok maybe not */
close
(
fds
[
0
]);
...
...
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论