Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
9a16cfd8
S
Startup Init Lite
项目概览
OpenHarmony
/
Startup Init Lite
接近 2 年 前同步成功
通知
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看板
未验证
提交
9a16cfd8
编写于
3月 21, 2023
作者:
O
openharmony_ci
提交者:
Gitee
3月 21, 2023
浏览文件
操作
浏览文件
下载
差异文件
!1822 Remove redundant macro definitions
Merge pull request !1822 from 许云通/master
上级
a7e38c38
6a2a28b1
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
10 addition
and
22 deletion
+10
-22
ueventd/ueventd_read_cfg.c
ueventd/ueventd_read_cfg.c
+10
-22
未找到文件。
ueventd/ueventd_read_cfg.c
浏览文件 @
9a16cfd8
...
...
@@ -33,18 +33,6 @@
// default item count in config files
#define DEFAULTITEMCOUNT (50)
#define SYS_CONFIG_PATH_NUM 0
#define SYS_CONFIG_ATTR_NUM 1
#define SYS_CONFIG_MODE_NUM 2
#define SYS_CONFIG_UID_NUM 3
#define SYS_CONFIG_GID_NUM 4
#define DEVICE_CONFIG_NAME_NUM 0
#define DEVICE_CONFIG_MODE_NUM 1
#define DEVICE_CONFIG_UID_NUM 2
#define DEVICE_CONFIG_GID_NUM 3
#define DEVICE_CONFIG_PARAM_NUM 4
typedef
enum
SECTION
{
SECTION_INVALID
=
-
1
,
SECTION_DEVICE
=
0
,
...
...
@@ -95,15 +83,15 @@ static int ParseDeviceConfig(char *p)
FreeStringVector
(
items
,
count
);
return
-
1
;
}
config
->
name
=
strdup
(
items
[
DEVICE_CONFIG_NAME_NUM
]);
// device node
config
->
name
=
strdup
(
items
[
0
]);
// device node
errno
=
0
;
config
->
mode
=
strtoul
(
items
[
DEVICE_CONFIG_MODE_NUM
],
NULL
,
OCTAL_BASE
);
config
->
mode
=
strtoul
(
items
[
1
],
NULL
,
OCTAL_BASE
);
// mode
INIT_ERROR_CHECK
(
errno
==
0
,
config
->
mode
=
DEVMODE
,
"Invalid mode in config file for device node %s. use default mode"
,
config
->
name
);
config
->
uid
=
(
uid_t
)
DecodeUid
(
items
[
DEVICE_CONFIG_UID_NUM
]);
config
->
gid
=
(
gid_t
)
DecodeGid
(
items
[
DEVICE_CONFIG_GID_NUM
]);
config
->
uid
=
(
uid_t
)
DecodeUid
(
items
[
2
]);
// uid
config
->
gid
=
(
gid_t
)
DecodeGid
(
items
[
3
]);
// gid
if
(
count
==
expectedCount
)
{
config
->
parameter
=
strdup
(
items
[
DEVICE_CONFIG_PARAM_NUM
]);
// device parameter
config
->
parameter
=
strdup
(
items
[
4
]);
// device parameter
}
else
{
config
->
parameter
=
NULL
;
}
...
...
@@ -134,14 +122,14 @@ static int ParseSysfsConfig(char *p)
FreeStringVector
(
items
,
count
);
return
-
1
;
}
config
->
sysPath
=
strdup
(
items
[
SYS_CONFIG_PATH_NUM
]);
// sys path
config
->
attr
=
strdup
(
items
[
SYS_CONFIG_ATTR_NUM
]);
// attribute
config
->
sysPath
=
strdup
(
items
[
0
]);
// sys path
config
->
attr
=
strdup
(
items
[
1
]);
// attribute
errno
=
0
;
config
->
mode
=
strtoul
(
items
[
SYS_CONFIG_MODE_NUM
],
NULL
,
OCTAL_BASE
);
config
->
mode
=
strtoul
(
items
[
2
],
NULL
,
OCTAL_BASE
);
// mode
INIT_ERROR_CHECK
(
errno
==
0
,
config
->
mode
=
DEVMODE
,
"Invalid mode in config file for sys path %s. use default mode"
,
config
->
sysPath
);
config
->
uid
=
(
uid_t
)
DecodeUid
(
items
[
SYS_CONFIG_UID_NUM
]);
config
->
gid
=
(
gid_t
)
DecodeGid
(
items
[
SYS_CONFIG_GID_NUM
]);
config
->
uid
=
(
uid_t
)
DecodeUid
(
items
[
3
]);
// uid
config
->
gid
=
(
gid_t
)
DecodeGid
(
items
[
4
]);
// gid
OH_ListAddTail
(
&
g_sysDevices
,
&
config
->
list
);
FreeStringVector
(
items
,
count
);
return
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录