Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
dragonwell8_jdk
提交
8e5dbd44
D
dragonwell8_jdk
项目概览
openanolis
/
dragonwell8_jdk
通知
4
Star
2
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
dragonwell8_jdk
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
8e5dbd44
编写于
9月 13, 2019
作者:
B
bpb
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
8230085: (fs) FileStore::isReadOnly is always true on macOS Catalina
Reviewed-by: alanb
上级
126d603b
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
44 addition
and
17 deletion
+44
-17
src/solaris/classes/sun/nio/fs/BsdFileStore.java
src/solaris/classes/sun/nio/fs/BsdFileStore.java
+6
-14
src/solaris/classes/sun/nio/fs/BsdNativeDispatcher.java
src/solaris/classes/sun/nio/fs/BsdNativeDispatcher.java
+15
-1
src/solaris/classes/sun/nio/fs/UnixNativeDispatcher.java
src/solaris/classes/sun/nio/fs/UnixNativeDispatcher.java
+1
-1
src/solaris/native/sun/nio/fs/BsdNativeDispatcher.c
src/solaris/native/sun/nio/fs/BsdNativeDispatcher.c
+22
-1
未找到文件。
src/solaris/classes/sun/nio/fs/BsdFileStore.java
浏览文件 @
8e5dbd44
/*
/*
* Copyright (c) 2008, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 201
9
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -62,22 +62,14 @@ class BsdFileStore
...
@@ -62,22 +62,14 @@ class BsdFileStore
}
}
// step 2: find mount point
// step 2: find mount point
UnixPath
parent
=
path
.
getParent
();
byte
[]
dir
=
null
;
while
(
parent
!=
null
)
{
try
{
UnixFileAttributes
attrs
=
null
;
dir
=
BsdNativeDispatcher
.
getmntonname
(
path
);
try
{
}
catch
(
UnixException
x
)
{
attrs
=
UnixFileAttributes
.
get
(
parent
,
true
);
x
.
rethrowAsIOException
(
path
);
}
catch
(
UnixException
x
)
{
x
.
rethrowAsIOException
(
parent
);
}
if
(
attrs
.
dev
()
!=
dev
())
break
;
path
=
parent
;
parent
=
parent
.
getParent
();
}
}
// step 3: lookup mounted file systems
// step 3: lookup mounted file systems
byte
[]
dir
=
path
.
asByteArray
();
for
(
UnixMountEntry
entry:
fs
.
getMountEntries
())
{
for
(
UnixMountEntry
entry:
fs
.
getMountEntries
())
{
if
(
Arrays
.
equals
(
dir
,
entry
.
dir
()))
if
(
Arrays
.
equals
(
dir
,
entry
.
dir
()))
return
entry
;
return
entry
;
...
...
src/solaris/classes/sun/nio/fs/BsdNativeDispatcher.java
浏览文件 @
8e5dbd44
/*
/*
* Copyright (c) 2008, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 201
9
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -51,6 +51,20 @@ class BsdNativeDispatcher extends UnixNativeDispatcher {
...
@@ -51,6 +51,20 @@ class BsdNativeDispatcher extends UnixNativeDispatcher {
*/
*/
static
native
void
endfsstat
(
long
iter
)
throws
UnixException
;
static
native
void
endfsstat
(
long
iter
)
throws
UnixException
;
/**
* int statfs(const char *path, struct statfs *buf);
* returns buf->f_mntonname (directory on which mounted)
*/
static
byte
[]
getmntonname
(
UnixPath
path
)
throws
UnixException
{
NativeBuffer
pathBuffer
=
copyToNativeBuffer
(
path
);
try
{
return
getmntonname0
(
pathBuffer
.
address
());
}
finally
{
pathBuffer
.
release
();
}
}
static
native
byte
[]
getmntonname0
(
long
pathAddress
)
throws
UnixException
;
// initialize field IDs
// initialize field IDs
private
static
native
void
initIDs
();
private
static
native
void
initIDs
();
...
...
src/solaris/classes/sun/nio/fs/UnixNativeDispatcher.java
浏览文件 @
8e5dbd44
...
@@ -36,7 +36,7 @@ class UnixNativeDispatcher {
...
@@ -36,7 +36,7 @@ class UnixNativeDispatcher {
protected
UnixNativeDispatcher
()
{
}
protected
UnixNativeDispatcher
()
{
}
// returns a NativeBuffer containing the given path
// returns a NativeBuffer containing the given path
private
static
NativeBuffer
copyToNativeBuffer
(
UnixPath
path
)
{
static
NativeBuffer
copyToNativeBuffer
(
UnixPath
path
)
{
byte
[]
cstr
=
path
.
getByteArrayForSysCalls
();
byte
[]
cstr
=
path
.
getByteArrayForSysCalls
();
int
size
=
cstr
.
length
+
1
;
int
size
=
cstr
.
length
+
1
;
NativeBuffer
buffer
=
NativeBuffers
.
getNativeBufferFromCache
(
size
);
NativeBuffer
buffer
=
NativeBuffers
.
getNativeBufferFromCache
(
size
);
...
...
src/solaris/native/sun/nio/fs/BsdNativeDispatcher.c
浏览文件 @
8e5dbd44
/*
/*
* Copyright (c) 2008, 201
2
, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2008, 201
9
, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
*
* This code is free software; you can redistribute it and/or modify it
* This code is free software; you can redistribute it and/or modify it
...
@@ -203,3 +203,24 @@ Java_sun_nio_fs_BsdNativeDispatcher_endfsstat(JNIEnv* env, jclass this, jlong va
...
@@ -203,3 +203,24 @@ Java_sun_nio_fs_BsdNativeDispatcher_endfsstat(JNIEnv* env, jclass this, jlong va
free
(
iter
);
free
(
iter
);
}
}
}
}
JNIEXPORT
jbyteArray
JNICALL
Java_sun_nio_fs_BsdNativeDispatcher_getmntonname0
(
JNIEnv
*
env
,
jclass
this
,
jlong
pathAddress
)
{
struct
statfs
buf
;
const
char
*
path
=
(
const
char
*
)
jlong_to_ptr
(
pathAddress
);
if
(
statfs
(
path
,
&
buf
)
!=
0
)
{
throwUnixException
(
env
,
errno
);
}
jsize
len
=
strlen
(
buf
.
f_mntonname
);
jbyteArray
mntonname
=
(
*
env
)
->
NewByteArray
(
env
,
len
);
if
(
mntonname
!=
NULL
)
{
(
*
env
)
->
SetByteArrayRegion
(
env
,
mntonname
,
0
,
len
,
(
jbyte
*
)
buf
.
f_mntonname
);
}
return
mntonname
;
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录