Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Third Party NuttX
提交
eb39f489
T
Third Party NuttX
项目概览
OpenHarmony
/
Third Party NuttX
大约 1 年 前同步成功
通知
5
Star
19
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
T
Third Party NuttX
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
eb39f489
编写于
8月 12, 2021
作者:
O
openharmony_ci
提交者:
Gitee
8月 12, 2021
浏览文件
操作
浏览文件
下载
差异文件
!44 feat(vfs): vfs支持FD_CLOEXEC标记
Merge pull request !44 from MGY917/master
上级
d72396f0
85bf0355
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
12 addition
and
17 deletion
+12
-17
fs/inode/fs_files.c
fs/inode/fs_files.c
+12
-17
未找到文件。
fs/inode/fs_files.c
浏览文件 @
eb39f489
...
...
@@ -363,17 +363,11 @@ int file_dup2(struct file *filep1, struct file *filep2)
/* Call the open method on the file, driver, mountpoint so that it
* can maintain the correct open counts.
*/
if
(
vnode_ptr
->
vop
)
{
if
(
vnode_ptr
->
originMount
)
if
(
vnode_ptr
->
flag
&
VNODE_FLAG_MOUNT_NEW
)
{
/* Dup the open file on the in the new file structure */
if
(
vnode_ptr
==
NULL
)
{
ret
=
-
ENOSYS
;
}
ret
=
-
ENOSYS
;
}
else
{
...
...
@@ -728,6 +722,7 @@ static void copy_fds(const struct fd_table_s *new_fdt, const struct fd_table_s *
(
void
)
memcpy_s
(
new_fdt
->
ft_fds
,
sz
,
old_fdt
->
ft_fds
,
sz
);
}
(
void
)
memcpy_s
(
new_fdt
->
proc_fds
,
sizeof
(
fd_set
),
old_fdt
->
proc_fds
,
sizeof
(
fd_set
));
(
void
)
memcpy_s
(
new_fdt
->
cloexec_fds
,
sizeof
(
fd_set
),
old_fdt
->
cloexec_fds
,
sizeof
(
fd_set
));
}
static
void
copy_fd_table
(
struct
fd_table_s
*
new_fdt
,
struct
fd_table_s
*
old_fdt
)
...
...
@@ -774,6 +769,7 @@ static struct fd_table_s * alloc_fd_table(unsigned int numbers)
{
fdt
->
ft_fds
=
NULL
;
fdt
->
proc_fds
=
NULL
;
fdt
->
cloexec_fds
=
NULL
;
return
fdt
;
}
data
=
LOS_MemAlloc
(
m_aucSysMem0
,
numbers
*
sizeof
(
struct
file_table_s
));
...
...
@@ -788,13 +784,14 @@ static struct fd_table_s * alloc_fd_table(unsigned int numbers)
fdt
->
ft_fds
[
i
].
sysFd
=
-
1
;
}
data
=
LOS_MemAlloc
(
m_aucSysMem0
,
sizeof
(
fd_set
));
data
=
LOS_MemAlloc
(
m_aucSysMem0
,
2
*
sizeof
(
fd_set
));
/* 2: proc_fds, cloexec_fds */
if
(
!
data
)
{
goto
out_arr
;
}
(
VOID
)
memset_s
(
data
,
sizeof
(
fd_set
),
0
,
sizeof
(
fd_set
));
fdt
->
proc_fds
=
data
;
(
VOID
)
memset_s
(
data
,
2
*
sizeof
(
fd_set
),
0
,
2
*
sizeof
(
fd_set
));
fdt
->
proc_fds
=
(
fd_set
*
)
data
;
fdt
->
cloexec_fds
=
(
fd_set
*
)((
uintptr_t
)
data
+
sizeof
(
fd_set
));
alloc_std_fd
(
fdt
);
...
...
@@ -878,15 +875,13 @@ struct files_struct *dup_fd(struct files_struct *old_files)
* Name: delete_files
*
* Description:
* Close a processCB's files specified by processCB and files
*
* Assumuptions:
* processCB->files may != files and processCB may != current processCB.
* Close a current process's fd specified by struct files.
* And delete files struct.
*
****************************************************************************/
void
delete_files
(
LosProcessCB
*
processCB
,
struct
files_struct
*
files
)
void
delete_files
(
struct
files_struct
*
files
)
{
if
(
files
==
NULL
||
processCB
==
NULL
)
if
(
files
==
NULL
)
{
return
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录