Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
bingbingbingbing
mono
提交
14f4fbe9
M
mono
项目概览
bingbingbingbing
/
mono
与 Fork 源项目一致
从无法访问的项目Fork
通知
35
Star
0
Fork
1
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
mono
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
提交
14f4fbe9
编写于
1月 29, 2011
作者:
M
Marek Habersack
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[runtime] Use IOAMP-aware method of looking for domain configuration file
上级
f93bb42f
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
41 addition
and
19 deletion
+41
-19
mono/metadata/appdomain.c
mono/metadata/appdomain.c
+15
-9
mono/metadata/assembly.c
mono/metadata/assembly.c
+10
-3
mono/metadata/icall.c
mono/metadata/icall.c
+11
-5
mono/utils/mono-io-portability.c
mono/utils/mono-io-portability.c
+5
-2
未找到文件。
mono/metadata/appdomain.c
浏览文件 @
14f4fbe9
...
...
@@ -816,7 +816,7 @@ void
mono_set_private_bin_path_from_config
(
MonoDomain
*
domain
)
{
MonoError
error
;
gchar
*
config_file
,
*
text
;
gchar
*
config_file
_name
=
NULL
,
*
text
=
NULL
,
*
config_file_path
=
NULL
;
gsize
len
;
GMarkupParseContext
*
context
;
RuntimeConfig
runtime_config
;
...
...
@@ -825,21 +825,23 @@ mono_set_private_bin_path_from_config (MonoDomain *domain)
if
(
!
domain
||
!
domain
->
setup
||
!
domain
->
setup
->
configuration_file
)
return
;
config_file
=
mono_string_to_utf8_checked
(
domain
->
setup
->
configuration_file
,
&
error
);
config_file
_name
=
mono_string_to_utf8_checked
(
domain
->
setup
->
configuration_file
,
&
error
);
if
(
!
mono_error_ok
(
&
error
))
{
mono_error_cleanup
(
&
error
);
return
;
goto
free_and_out
;
}
if
(
!
g_file_get_contents
(
config_file
,
&
text
,
&
len
,
NULL
))
{
g_free
(
config_file
);
return
;
}
config_file_path
=
mono_portability_find_file
(
config_file_name
,
TRUE
);
if
(
!
config_file_path
)
config_file_path
=
config_file_name
;
if
(
!
g_file_get_contents
(
config_file_path
,
&
text
,
&
len
,
NULL
))
goto
free_and_out
;
runtime_config
.
runtime_count
=
0
;
runtime_config
.
assemblybinding_count
=
0
;
runtime_config
.
domain
=
domain
;
runtime_config
.
filename
=
config_file
;
runtime_config
.
filename
=
config_file
_path
;
offset
=
0
;
if
(
len
>
3
&&
text
[
0
]
==
'\xef'
&&
text
[
1
]
==
(
gchar
)
'\xbb'
&&
text
[
2
]
==
'\xbf'
)
...
...
@@ -849,8 +851,12 @@ mono_set_private_bin_path_from_config (MonoDomain *domain)
if
(
g_markup_parse_context_parse
(
context
,
text
+
offset
,
len
-
offset
,
NULL
))
g_markup_parse_context_end_parse
(
context
,
NULL
);
g_markup_parse_context_free
(
context
);
free_and_out:
g_free
(
text
);
g_free
(
config_file
);
if
(
config_file_name
!=
config_file_path
)
g_free
(
config_file_name
);
g_free
(
config_file_path
);
}
MonoAppDomain
*
...
...
mono/metadata/assembly.c
浏览文件 @
14f4fbe9
...
...
@@ -32,6 +32,7 @@
#include <mono/utils/mono-path.h>
#include <mono/metadata/reflection.h>
#include <mono/metadata/coree.h>
#include <mono/utils/mono-io-portability.h>
#ifndef HOST_WIN32
#include <sys/types.h>
...
...
@@ -2457,11 +2458,17 @@ mono_assembly_apply_binding (MonoAssemblyName *aname, MonoAssemblyName *dest_nam
if
(
domain
&&
domain
->
setup
&&
domain
->
setup
->
configuration_file
)
{
mono_domain_lock
(
domain
);
if
(
!
domain
->
assembly_bindings_parsed
)
{
gchar
*
domain_config_file
=
mono_string_to_utf8
(
domain
->
setup
->
configuration_file
);
gchar
*
domain_config_file_name
=
mono_string_to_utf8
(
domain
->
setup
->
configuration_file
);
gchar
*
domain_config_file_path
=
mono_portability_find_file
(
domain_config_file_name
,
TRUE
);
mono_config_parse_assembly_bindings
(
domain_config_file
,
aname
->
major
,
aname
->
minor
,
domain
,
assembly_binding_info_parsed
);
if
(
!
domain_config_file_path
)
domain_config_file_path
=
domain_config_file_name
;
mono_config_parse_assembly_bindings
(
domain_config_file_path
,
aname
->
major
,
aname
->
minor
,
domain
,
assembly_binding_info_parsed
);
domain
->
assembly_bindings_parsed
=
TRUE
;
g_free
(
domain_config_file
);
if
(
domain_config_file_name
!=
domain_config_file_path
)
g_free
(
domain_config_file_name
);
g_free
(
domain_config_file_path
);
}
mono_domain_unlock
(
domain
);
...
...
mono/metadata/icall.c
浏览文件 @
14f4fbe9
...
...
@@ -77,6 +77,7 @@
#include <mono/utils/mono-string.h>
#include <mono/utils/mono-error-internals.h>
#include <mono/utils/mono-mmap.h>
#include <mono/utils/mono-io-portability.h>
#if defined (HOST_WIN32)
#include <windows.h>
...
...
@@ -6920,7 +6921,7 @@ get_bundled_app_config (void)
const
gchar
*
app_config
;
MonoDomain
*
domain
;
MonoString
*
file
;
gchar
*
config_file
;
gchar
*
config_file
_name
,
*
config_file_path
;
gsize
len
;
gchar
*
module
;
...
...
@@ -6932,15 +6933,20 @@ get_bundled_app_config (void)
return
NULL
;
// Retrieve config file and remove the extension
config_file
=
mono_string_to_utf8
(
file
);
len
=
strlen
(
config_file
)
-
strlen
(
".config"
);
config_file_name
=
mono_string_to_utf8
(
file
);
config_file_path
=
mono_portability_find_file
(
config_file_name
,
TRUE
);
if
(
!
config_file_path
)
config_file_path
=
config_file_name
;
len
=
strlen
(
config_file_path
)
-
strlen
(
".config"
);
module
=
g_malloc0
(
len
+
1
);
memcpy
(
module
,
config_file
,
len
);
memcpy
(
module
,
config_file
_path
,
len
);
// Get the config file from the module name
app_config
=
mono_config_string_for_assembly_file
(
module
);
// Clean-up
g_free
(
module
);
g_free
(
config_file
);
if
(
config_file_name
!=
config_file_path
)
g_free
(
config_file_name
);
g_free
(
config_file_path
);
if
(
!
app_config
)
return
NULL
;
...
...
mono/utils/mono-io-portability.c
浏览文件 @
14f4fbe9
...
...
@@ -25,7 +25,6 @@ mono_portability_helpers_init (void)
gchar
*
mono_portability_find_file
(
const
gchar
*
pathname
,
gboolean
last_exists
)
{
g_assert_not_reached
();
return
NULL
;
}
...
...
@@ -147,7 +146,11 @@ static inline void do_mono_profiler_iomap (GString **report, const char *pathnam
gchar
*
mono_portability_find_file
(
const
gchar
*
pathname
,
gboolean
last_exists
)
{
GString
*
report
=
NULL
;
gchar
*
ret
=
mono_portability_find_file_internal
(
&
report
,
pathname
,
last_exists
);
gchar
*
ret
;
if
(
!
pathname
||
!
pathname
[
0
])
return
NULL
;
ret
=
mono_portability_find_file_internal
(
&
report
,
pathname
,
last_exists
);
if
(
report
)
g_string_free
(
report
,
TRUE
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录