Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
iSulad
提交
cccfdc7b
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,发现更多精彩内容 >>
提交
cccfdc7b
编写于
2月 17, 2020
作者:
L
leizhongkai
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix the compilation error for non-C99 mode
Signed-off-by:
N
leizhongkai
<
leizhongkai@huawei.com
>
上级
ff8d5214
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
22 addition
and
12 deletion
+22
-12
src/cmd/isulad-shim/process.c
src/cmd/isulad-shim/process.c
+20
-11
src/services/execution/execute/execution_create.c
src/services/execution/execute/execution_create.c
+2
-1
未找到文件。
src/cmd/isulad-shim/process.c
浏览文件 @
cccfdc7b
...
...
@@ -83,6 +83,7 @@ static int open_fifo_noblock(const char *path, mode_t mode)
static
int
receive_fd
(
int
sock
)
{
u_char
*
pfd
=
NULL
;
int
fd
=
-
1
;
int
cmsgsize
=
CMSG_LEN
(
sizeof
(
int
));
struct
cmsghdr
*
cmptr
=
(
struct
cmsghdr
*
)
calloc
(
1
,
cmsgsize
);
...
...
@@ -110,7 +111,8 @@ static int receive_fd(int sock)
return
-
1
;
}
fd
=
*
(
int
*
)
CMSG_DATA
(
cmptr
);
pfd
=
CMSG_DATA
(
cmptr
);
fd
=
*
(
int
*
)
pfd
;
free
(
cmptr
);
return
fd
;
...
...
@@ -457,6 +459,7 @@ static void* task_io_loop(void *data)
process_t
*
p
=
(
process_t
*
)
data
;
int
wait_fds
=
0
;
struct
epoll_event
evs
[
MAX_EVENTS
];
int
i
;
p
->
io_loop_fd
=
epoll_create1
(
EPOLL_CLOEXEC
);
if
(
p
->
io_loop_fd
<
0
)
{
...
...
@@ -474,7 +477,7 @@ static void* task_io_loop(void *data)
_exit
(
EXIT_FAILURE
);
}
for
(
i
nt
i
=
0
;
i
<
wait_fds
;
i
++
)
{
for
(
i
=
0
;
i
<
wait_fds
;
i
++
)
{
io_thread_t
*
thd_io
=
(
io_thread_t
*
)
evs
[
i
].
data
.
ptr
;
do_io_copy
(
thd_io
->
ioc
->
fd_from
,
evs
[
i
].
events
,
thd_io
);
}
...
...
@@ -560,6 +563,7 @@ static stdio_t* initialize_io(process_t *p)
{
int
ret
=
SHIM_ERR
;
int
stdio_fd
[
3
][
2
]
=
{
{
-
1
,
-
1
},
{
-
1
,
-
1
},
{
-
1
,
-
1
}
};
int
i
,
j
;
stdio_t
*
stdio
=
(
stdio_t
*
)
calloc
(
1
,
sizeof
(
stdio_t
));
p
->
stdio
=
(
stdio_t
*
)
calloc
(
1
,
sizeof
(
stdio_t
));
...
...
@@ -581,8 +585,8 @@ static stdio_t* initialize_io(process_t *p)
p
->
stdio
->
err
=
stdio_fd
[
2
][
1
];
// w
stdio
->
err
=
stdio_fd
[
2
][
0
];
// r
for
(
i
nt
i
=
0
;
i
<
3
;
i
++
)
{
for
(
int
j
=
0
;
j
<
2
;
j
++
)
{
for
(
i
=
0
;
i
<
3
;
i
++
)
{
for
(
j
=
0
;
j
<
2
;
j
++
)
{
ret
=
fchown
(
stdio_fd
[
i
][
j
],
p
->
state
->
root_uid
,
p
->
state
->
root_gid
);
if
(
ret
!=
SHIM_OK
)
{
goto
failure
;
...
...
@@ -601,8 +605,8 @@ failure:
free
(
p
->
stdio
);
p
->
stdio
=
NULL
;
}
for
(
i
nt
i
=
0
;
i
<
3
;
i
++
)
{
for
(
int
j
=
0
;
j
<
2
;
j
++
)
{
for
(
i
=
0
;
i
<
3
;
i
++
)
{
for
(
j
=
0
;
j
<
2
;
j
++
)
{
if
(
stdio_fd
[
i
][
j
]
>
0
)
{
close
(
stdio_fd
[
i
][
j
]);
}
...
...
@@ -673,6 +677,7 @@ process_t* new_process(char *id, char *bundle, char *runtime)
{
shim_client_process_state
*
p_state
;
process_t
*
p
=
NULL
;
int
i
;
p_state
=
load_process
();
if
(
p_state
==
NULL
)
{
...
...
@@ -694,7 +699,7 @@ process_t* new_process(char *id, char *bundle, char *runtime)
p
->
ctr_pid
=
-
1
;
p
->
stdio
=
NULL
;
p
->
shim_io
=
NULL
;
for
(
i
nt
i
=
0
;
i
<
3
;
i
++
)
{
for
(
i
=
0
;
i
<
3
;
i
++
)
{
p
->
io_threads
[
i
]
=
NULL
;
}
...
...
@@ -735,8 +740,9 @@ static void get_runtime_cmd(process_t *p, const char *log_path, const char *pid_
const
char
*
params
[])
{
int
i
=
0
;
int
j
;
params
[
i
++
]
=
p
->
runtime
;
for
(
int
j
=
0
;
j
<
p
->
state
->
runtime_args_len
;
j
++
)
{
for
(
j
=
0
;
j
<
p
->
state
->
runtime_args_len
;
j
++
)
{
params
[
i
++
]
=
p
->
state
->
runtime_args
[
j
];
}
params
[
i
++
]
=
"--log"
;
...
...
@@ -796,9 +802,10 @@ static void process_kill_all(process_t *p)
char
output
[
BUFSIZ
]
=
{
0
};
int
output_len
=
BUFSIZ
;
int
i
=
0
;
int
j
;
params
[
i
++
]
=
p
->
runtime
;
for
(
int
j
=
0
;
j
<
p
->
state
->
runtime_args_len
;
j
++
)
{
for
(
j
=
0
;
j
<
p
->
state
->
runtime_args_len
;
j
++
)
{
params
[
i
++
]
=
p
->
state
->
runtime_args
[
j
];
}
params
[
i
++
]
=
"kill"
;
...
...
@@ -821,6 +828,7 @@ void process_delete(process_t *p)
char
output
[
BUFSIZ
]
=
{
0
};
int
output_len
=
BUFSIZ
;
int
i
=
0
;
int
j
;
char
log_path
[
PATH_MAX
]
=
{
0
};
char
*
cwd
;
...
...
@@ -836,7 +844,7 @@ void process_delete(process_t *p)
params
[
i
++
]
=
"--log-format"
;
params
[
i
++
]
=
"json"
;
params
[
i
++
]
=
p
->
runtime
;
for
(
int
j
=
0
;
j
<
p
->
state
->
runtime_args_len
;
j
++
)
{
for
(
j
=
0
;
j
<
p
->
state
->
runtime_args_len
;
j
++
)
{
params
[
i
++
]
=
p
->
state
->
runtime_args
[
j
];
}
...
...
@@ -966,6 +974,7 @@ int process_signal_handle_routine(process_t *p)
{
int
ret
=
SHIM_ERR
;
bool
exit_shim
=
false
;
int
i
;
for
(;;)
{
int
status
;
...
...
@@ -994,7 +1003,7 @@ int process_signal_handle_routine(process_t *p)
if
(
exit_shim
)
{
process_kill_all
(
p
);
process_delete
(
p
);
for
(
i
nt
i
=
0
;
i
<
3
;
i
++
)
{
for
(
i
=
0
;
i
<
3
;
i
++
)
{
destory_io_thread
(
p
,
i
);
}
return
status
;
...
...
src/services/execution/execute/execution_create.c
浏览文件 @
cccfdc7b
...
...
@@ -71,7 +71,8 @@ static int runtime_check(const char *name, bool *runtime_res)
}
size_t
runtime_nums
=
runtimes
->
len
;
for
(
size_t
i
=
0
;
i
<
runtime_nums
;
i
++
)
{
size_t
i
;
for
(
i
=
0
;
i
<
runtime_nums
;
i
++
)
{
if
(
strcmp
(
name
,
runtimes
->
keys
[
i
])
==
0
)
{
*
runtime_res
=
true
;
goto
unlock_out
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录