Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
anbox
提交
dfdad4aa
A
anbox
项目概览
openeuler
/
anbox
通知
24
Star
1
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
anbox
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
dfdad4aa
编写于
5月 05, 2017
作者:
S
Simon Fels
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Integrate review feedback
上级
7fe8cfeb
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
14 addition
and
12 deletion
+14
-12
src/anbox/cmds/launch.cpp
src/anbox/cmds/launch.cpp
+11
-4
src/anbox/config.cpp
src/anbox/config.cpp
+1
-1
src/anbox/config.h
src/anbox/config.h
+1
-1
src/anbox/ui/splash_screen.cpp
src/anbox/ui/splash_screen.cpp
+1
-6
未找到文件。
src/anbox/cmds/launch.cpp
浏览文件 @
dfdad4aa
...
...
@@ -88,8 +88,8 @@ anbox::cmds::Launch::Launch()
const
auto
snap_path
=
utils
::
get_env_value
(
"SNAP"
);
if
(
!
snap_path
.
empty
())
{
const
auto
resource_path
=
utils
::
string_format
(
"%s/usr/share/anbox"
,
snap_path
)
;
SystemConfiguration
::
instance
().
set_resource_path
(
resource_path
);
const
auto
resource_path
=
fs
::
path
(
snap_path
)
/
"usr"
/
"share"
/
"anbox"
;
SystemConfiguration
::
instance
().
set_resource_path
(
resource_path
.
string
()
);
}
std
::
shared_ptr
<
ui
::
SplashScreen
>
ss
;
...
...
@@ -126,12 +126,17 @@ anbox::cmds::Launch::Launch()
}
try
{
const
auto
flags
=
core
::
posix
::
StandardStream
::
empty
;
// core::posix::StandardStream::
stdout | core::posix::StandardStream::stderr;
const
auto
flags
=
core
::
posix
::
StandardStream
::
stdout
|
core
::
posix
::
StandardStream
::
stderr
;
auto
child
=
core
::
posix
::
fork
([
&
]()
{
auto
grandchild
=
core
::
posix
::
exec
(
exe_path
,
args
,
env
,
flags
);
grandchild
.
dont_kill_on_cleanup
();
return
core
::
posix
::
exit
::
Status
::
success
;
},
flags
);
// We don't wait for the grandchild but the child as we use double forking
// here to break through the process hierarchy and make the grandchild a
// direct child of the init process so it keeps running on its own and
// indepent of our short living process here.
child
.
wait_for
(
core
::
posix
::
wait
::
Flags
::
untraced
);
DEBUG
(
"Started session manager, will now try to connect .."
);
...
...
@@ -173,8 +178,10 @@ anbox::cmds::Launch::Launch()
boost
::
asio
::
deadline_timer
timer
(
rt
->
service
());
timer
.
expires_from_now
(
max_wait_timeout
);
timer
.
async_wait
([
&
](
const
boost
::
system
::
error_code
&
)
{
WARNING
(
"Stopped waiting as we'
r
e already waited for too long. Something"
);
WARNING
(
"Stopped waiting as we'
v
e already waited for too long. Something"
);
WARNING
(
"is wrong with your setup or the container has failed to boot."
);
WARNING
(
"If you think you found a bug please don't hesitate to file on"
);
WARNING
(
"at https://github.com/anbox/anbox/issues/new"
);
trap
->
stop
();
});
...
...
src/anbox/config.cpp
浏览文件 @
dfdad4aa
...
...
@@ -41,7 +41,7 @@ void anbox::SystemConfiguration::set_data_path(const std::string &path) {
data_path
=
path
;
}
void
anbox
::
SystemConfiguration
::
set_resource_path
(
const
std
::
string
&
path
)
{
void
anbox
::
SystemConfiguration
::
set_resource_path
(
const
fs
::
path
&
path
)
{
resource_path
=
path
;
}
...
...
src/anbox/config.h
浏览文件 @
dfdad4aa
...
...
@@ -31,7 +31,7 @@ class SystemConfiguration {
virtual
~
SystemConfiguration
()
=
default
;
void
set_data_path
(
const
std
::
string
&
path
);
void
set_resource_path
(
const
std
::
string
&
path
);
void
set_resource_path
(
const
boost
::
filesystem
&
path
);
boost
::
filesystem
::
path
data_dir
()
const
;
std
::
string
rootfs_dir
()
const
;
...
...
src/anbox/ui/splash_screen.cpp
浏览文件 @
dfdad4aa
...
...
@@ -82,12 +82,7 @@ void SplashScreen::process_events() {
while
(
event_thread_running_
)
{
SDL_Event
event
;
while
(
SDL_WaitEventTimeout
(
&
event
,
100
))
{
switch
(
event
.
type
)
{
case
SDL_QUIT
:
break
;
default:
break
;
}
// Keep running until we're terminated
}
}
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录