Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
iSulad
提交
0969094b
I
iSulad
项目概览
openeuler
/
iSulad
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
iSulad
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
0969094b
编写于
3月 19, 2020
作者:
L
LiFeng
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
iSulad: update container id before create threads
Signed-off-by:
N
LiFeng
<
lifeng68@huawei.com
>
上级
1e077449
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
22 deletion
+12
-22
src/cmd/isula/stream/exec.c
src/cmd/isula/stream/exec.c
+12
-22
未找到文件。
src/cmd/isula/stream/exec.c
浏览文件 @
0969094b
...
@@ -153,17 +153,6 @@ static int exec_prepare_console(struct command_fifo_config **command_fifos, bool
...
@@ -153,17 +153,6 @@ static int exec_prepare_console(struct command_fifo_config **command_fifos, bool
{
{
int
ret
=
0
;
int
ret
=
0
;
int
istty
=
0
;
int
istty
=
0
;
container_inspect
*
inspect_data
=
NULL
;
if
(
inspect_container
(
&
g_cmd_exec_args
,
&
inspect_data
))
{
ERROR
(
"inspect data error"
);
ret
=
ECOMMON
;
goto
out
;
}
if
(
inspect_data
->
id
!=
NULL
)
{
g_cmd_exec_args
.
name
=
util_strdup_s
(
inspect_data
->
id
);
}
istty
=
isatty
(
0
);
istty
=
isatty
(
0
);
if
(
istty
&&
custom_cfg
->
tty
&&
custom_cfg
->
attach_stdin
)
{
if
(
istty
&&
custom_cfg
->
tty
&&
custom_cfg
->
attach_stdin
)
{
...
@@ -196,7 +185,6 @@ static int exec_prepare_console(struct command_fifo_config **command_fifos, bool
...
@@ -196,7 +185,6 @@ static int exec_prepare_console(struct command_fifo_config **command_fifos, bool
}
}
out:
out:
free_container_inspect
(
inspect_data
);
return
ret
;
return
ret
;
}
}
...
@@ -228,7 +216,6 @@ static int remote_cmd_exec(const struct client_arguments *args, uint32_t *exit_c
...
@@ -228,7 +216,6 @@ static int remote_cmd_exec(const struct client_arguments *args, uint32_t *exit_c
client_connect_config_t
config
=
{
0
};
client_connect_config_t
config
=
{
0
};
struct
termios
oldtios
;
struct
termios
oldtios
;
bool
reset_tty
=
false
;
bool
reset_tty
=
false
;
container_inspect
*
inspect_data
=
NULL
;
ops
=
get_connect_client_ops
();
ops
=
get_connect_client_ops
();
if
(
ops
==
NULL
||
!
ops
->
container
.
remote_exec
)
{
if
(
ops
==
NULL
||
!
ops
->
container
.
remote_exec
)
{
...
@@ -242,14 +229,6 @@ static int remote_cmd_exec(const struct client_arguments *args, uint32_t *exit_c
...
@@ -242,14 +229,6 @@ static int remote_cmd_exec(const struct client_arguments *args, uint32_t *exit_c
return
ECOMMON
;
return
ECOMMON
;
}
}
if
(
inspect_container
(
args
,
&
inspect_data
))
{
ERROR
(
"inspect data error"
);
ret
=
ECOMMON
;
goto
out
;
}
g_cmd_exec_args
.
name
=
util_strdup_s
(
inspect_data
->
id
);
request
.
name
=
args
->
name
;
request
.
name
=
args
->
name
;
request
.
suffix
=
args
->
exec_suffix
;
request
.
suffix
=
args
->
exec_suffix
;
request
.
tty
=
args
->
custom_conf
.
tty
;
request
.
tty
=
args
->
custom_conf
.
tty
;
...
@@ -279,7 +258,6 @@ static int remote_cmd_exec(const struct client_arguments *args, uint32_t *exit_c
...
@@ -279,7 +258,6 @@ static int remote_cmd_exec(const struct client_arguments *args, uint32_t *exit_c
}
}
out:
out:
free_container_inspect
(
inspect_data
);
if
(
reset_tty
&&
tcsetattr
(
0
,
TCSAFLUSH
,
&
oldtios
)
<
0
)
{
if
(
reset_tty
&&
tcsetattr
(
0
,
TCSAFLUSH
,
&
oldtios
)
<
0
)
{
WARN
(
"Failed to reset terminal properties: %s."
,
strerror
(
errno
));
WARN
(
"Failed to reset terminal properties: %s."
,
strerror
(
errno
));
}
}
...
@@ -435,6 +413,7 @@ int cmd_exec_main(int argc, const char **argv)
...
@@ -435,6 +413,7 @@ int cmd_exec_main(int argc, const char **argv)
int
ret
=
0
;
int
ret
=
0
;
uint32_t
exit_code
=
0
;
uint32_t
exit_code
=
0
;
struct
custom_configs
*
custom_cfg
=
NULL
;
struct
custom_configs
*
custom_cfg
=
NULL
;
container_inspect
*
inspect_data
=
NULL
;
ret
=
exec_cmd_init
(
argc
,
argv
);
ret
=
exec_cmd_init
(
argc
,
argv
);
if
(
ret
)
{
if
(
ret
)
{
...
@@ -463,6 +442,16 @@ int cmd_exec_main(int argc, const char **argv)
...
@@ -463,6 +442,16 @@ int cmd_exec_main(int argc, const char **argv)
goto
out
;
goto
out
;
}
}
if
(
inspect_container
(
&
g_cmd_exec_args
,
&
inspect_data
))
{
ERROR
(
"inspect data error"
);
ret
=
ECOMMON
;
goto
out
;
}
if
(
inspect_data
->
id
!=
NULL
)
{
g_cmd_exec_args
.
name
=
util_strdup_s
(
inspect_data
->
id
);
}
if
(
custom_cfg
->
tty
&&
isatty
(
STDIN_FILENO
)
&&
(
custom_cfg
->
attach_stdin
||
custom_cfg
->
attach_stdout
||
if
(
custom_cfg
->
tty
&&
isatty
(
STDIN_FILENO
)
&&
(
custom_cfg
->
attach_stdin
||
custom_cfg
->
attach_stdout
||
custom_cfg
->
attach_stderr
))
{
custom_cfg
->
attach_stderr
))
{
(
void
)
exec_client_console_resize_thread
(
&
g_cmd_exec_args
);
(
void
)
exec_client_console_resize_thread
(
&
g_cmd_exec_args
);
...
@@ -483,6 +472,7 @@ int cmd_exec_main(int argc, const char **argv)
...
@@ -483,6 +472,7 @@ int cmd_exec_main(int argc, const char **argv)
}
}
out:
out:
free_container_inspect
(
inspect_data
);
exit
(
exit_code
?
(
int
)
exit_code
:
ret
);
exit
(
exit_code
?
(
int
)
exit_code
:
ret
);
}
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录