Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
4e94e0bb
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
1 年多 前同步成功
通知
3
Star
37
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
S
Startup Init Lite
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
4e94e0bb
编写于
7月 29, 2022
作者:
M
Mupceet
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add mutex for workspace
Signed-off-by:
N
Mupceet
<
laiguizhong@huawei.com
>
上级
466ea295
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
15 addition
and
3 deletion
+15
-3
services/param/adapter/param_dac.c
services/param/adapter/param_dac.c
+1
-1
services/param/linux/param_osadp.c
services/param/linux/param_osadp.c
+14
-0
services/param/linux/param_request.c
services/param/linux/param_request.c
+0
-2
未找到文件。
services/param/adapter/param_dac.c
浏览文件 @
4e94e0bb
...
...
@@ -211,7 +211,7 @@ static int CheckFilePermission(const ParamSecurityLabel *localLabel, const char
static
int
CheckUserInGroup
(
WorkSpace
*
space
,
gid_t
groupId
,
uid_t
uid
)
{
#ifdef __MUSL__
static
char
buffer
[
USER_BUFFER_LEN
]
=
{
0
};
char
buffer
[
USER_BUFFER_LEN
]
=
{
0
};
uint32_t
labelIndex
=
0
;
int
ret
=
ParamSprintf
(
buffer
,
sizeof
(
buffer
),
"%s.%d.%d"
,
GROUP_FORMAT
,
groupId
,
uid
);
PARAM_CHECK
(
ret
>=
0
,
return
-
1
,
"Failed to format name for %s.%d.%d"
,
GROUP_FORMAT
,
groupId
,
uid
);
...
...
services/param/linux/param_osadp.c
浏览文件 @
4e94e0bb
...
...
@@ -29,23 +29,37 @@ void paramMutexEnvInit(void)
int
ParamRWMutexCreate
(
ParamRWMutex
*
lock
)
{
PARAM_CHECK
(
lock
!=
NULL
,
return
-
1
,
"Invalid lock"
);
pthread_rwlockattr_t
rwlockatt
;
pthread_rwlockattr_init
(
&
rwlockatt
);
pthread_rwlockattr_setpshared
(
&
rwlockatt
,
PTHREAD_PROCESS_SHARED
);
pthread_rwlock_init
(
&
lock
->
rwlock
,
&
rwlockatt
);
return
0
;
}
int
ParamRWMutexWRLock
(
ParamRWMutex
*
lock
)
{
PARAM_CHECK
(
lock
!=
NULL
,
return
-
1
,
"Invalid lock"
);
pthread_rwlock_wrlock
(
&
lock
->
rwlock
);
return
0
;
}
int
ParamRWMutexRDLock
(
ParamRWMutex
*
lock
)
{
PARAM_CHECK
(
lock
!=
NULL
,
return
-
1
,
"Invalid lock"
);
pthread_rwlock_rdlock
(
&
lock
->
rwlock
);
return
0
;
}
int
ParamRWMutexUnlock
(
ParamRWMutex
*
lock
)
{
PARAM_CHECK
(
lock
!=
NULL
,
return
-
1
,
"Invalid lock"
);
pthread_rwlock_unlock
(
&
lock
->
rwlock
);
return
0
;
}
int
ParamRWMutexDelete
(
ParamRWMutex
*
lock
)
{
PARAM_CHECK
(
lock
!=
NULL
,
return
-
1
,
"Invalid lock"
);
uint32_t
ret
=
pthread_rwlock_destroy
(
&
lock
->
rwlock
);
PARAM_CHECK
(
ret
==
0
,
return
-
1
,
"Failed to mutex lock ret %d"
,
ret
);
return
0
;
}
...
...
services/param/linux/param_request.c
浏览文件 @
4e94e0bb
...
...
@@ -40,7 +40,6 @@ __attribute__((constructor)) static void ParameterInit(void)
return
;
}
EnableInitLog
(
INIT_INFO
);
PARAM_LOGI
(
"ParameterInit "
);
InitParamWorkSpace
(
1
);
}
...
...
@@ -51,7 +50,6 @@ __attribute__((destructor)) static void ParameterDeinit(void)
close
(
g_clientFd
);
g_clientFd
=
INVALID_SOCKET
;
}
CloseParamWorkSpace
();
pthread_mutex_destroy
(
&
g_clientMutex
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录