Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Startup Init Lite
提交
8d948a8b
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看板
提交
8d948a8b
编写于
10月 15, 2021
作者:
S
sun_fan
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
init: fix codedex
Signed-off-by:
N
sun_fan
<
sun_fan1@hoperun.com
>
上级
f88b96f4
变更
20
隐藏空白更改
内联
并排
Showing
20 changed file
with
104 addition
and
91 deletion
+104
-91
interfaces/innerkits/fs_manager/fstab.c
interfaces/innerkits/fs_manager/fstab.c
+18
-16
interfaces/innerkits/fs_manager/fstab_mount.c
interfaces/innerkits/fs_manager/fstab_mount.c
+10
-9
interfaces/innerkits/include/fs_manager/fs_manager.h
interfaces/innerkits/include/fs_manager/fs_manager.h
+4
-3
services/include/switch_root.h
services/include/switch_root.h
+6
-4
services/init/lite/init.c
services/init/lite/init.c
+1
-1
services/init/lite/init_cmds.c
services/init/lite/init_cmds.c
+3
-1
services/init/main.c
services/init/main.c
+1
-0
services/init/standard/init.c
services/init/standard/init.c
+1
-1
services/init/standard/init_cmds.c
services/init/standard/init_cmds.c
+1
-1
services/init/standard/switch_root.c
services/init/standard/switch_root.c
+9
-8
services/log/init_log.h
services/log/init_log.h
+8
-2
services/param/adapter/param_libuvadp.c
services/param/adapter/param_libuvadp.c
+1
-1
services/param/cmd/param_cmd.c
services/param/cmd/param_cmd.c
+1
-12
services/param/include/param_message.h
services/param/include/param_message.h
+1
-1
services/param/trigger/trigger_processor.c
services/param/trigger/trigger_processor.c
+2
-2
services/param/watcher/agent/watcher_manager_kits.h
services/param/watcher/agent/watcher_manager_kits.h
+4
-1
services/utils/init_utils.c
services/utils/init_utils.c
+1
-1
ueventd/ueventd.c
ueventd/ueventd.c
+29
-24
ueventd/ueventd_device_handler.c
ueventd/ueventd_device_handler.c
+1
-1
ueventd/ueventd_firmware_handler.c
ueventd/ueventd_firmware_handler.c
+2
-2
未找到文件。
interfaces/innerkits/fs_manager/fstab.c
浏览文件 @
8d948a8b
...
...
@@ -13,16 +13,11 @@
* limitations under the License.
*/
#ifdef __cplusplus
#if __cplusplus
extern
"C"
{
#endif
#endif
#include <ctype.h>
#include <stdio.h>
#include <fcntl.h>
#include <limits.h>
#include <libgen.h>
#include <limits.h>
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <sys/mount.h>
...
...
@@ -33,6 +28,12 @@ extern "C" {
#include "init_utils.h"
#include "securec.h"
#ifdef __cplusplus
#if __cplusplus
extern
"C"
{
#endif
#endif
struct
FsManagerFlags
{
char
*
name
;
unsigned
int
flags
;
...
...
@@ -89,7 +90,7 @@ static void AddToFstab(Fstab *fstab, FstabItem *item)
void
ReleaseFstabItem
(
FstabItem
*
item
)
{
if
(
item
!=
NULL
)
{
if
(
item
!=
NULL
)
{
if
(
item
->
deviceName
!=
NULL
)
{
free
(
item
->
deviceName
);
item
->
deviceName
=
NULL
;
...
...
@@ -111,7 +112,7 @@ void ReleaseFstabItem(FstabItem *item)
}
free
(
item
);
item
=
NULL
;
}
}
}
void
ReleaseFstab
(
Fstab
*
fstab
)
...
...
@@ -238,14 +239,14 @@ Fstab *ReadFstabFromFile(const char *file, bool procMounts)
}
// If one line in fstab file parsed with a failure. just give a warning
// and skip it.
printf
(
"[fs_manager][warning] Cannot parse file
\"
%s
\"
at line %u. skip it
\n
"
,
file
,
ln
);
printf
(
"[fs_manager][warning] Cannot parse file
\"
%s
\"
at line %
z
u. skip it
\n
"
,
file
,
ln
);
continue
;
}
}
if
(
line
!=
NULL
)
{
free
(
line
);
}
fclose
(
fp
);
(
void
)
fclose
(
fp
);
fp
=
NULL
;
return
fstab
;
}
...
...
@@ -312,7 +313,8 @@ static const struct MountFlags mountFlags[] = {
{
"defaults"
,
0
},
};
static
bool
IsDefaultMountFlags
(
const
char
*
str
)
{
static
bool
IsDefaultMountFlags
(
const
char
*
str
)
{
bool
isDefault
=
false
;
if
(
str
!=
NULL
)
{
...
...
@@ -330,7 +332,7 @@ static unsigned long ParseDefaultMountFlag(const char *str)
unsigned
long
flags
=
0
;
if
(
str
!=
NULL
)
{
for
(
size_t
i
=
0
;
i
<
ARRAY_LENGTH
(
mountFlags
);
i
++
)
{
for
(
size_t
i
=
0
;
i
<
ARRAY_LENGTH
(
mountFlags
);
i
++
)
{
if
(
strcmp
(
str
,
mountFlags
[
i
].
name
)
==
0
)
{
flags
=
mountFlags
[
i
].
flags
;
break
;
...
...
@@ -340,11 +342,11 @@ static unsigned long ParseDefaultMountFlag(const char *str)
return
flags
;
}
unsigned
long
GetMountFlags
(
char
*
mountF
lags
,
char
*
fsSpecificData
,
size_t
fsSpecificDataSize
)
unsigned
long
GetMountFlags
(
char
*
f
lags
,
char
*
fsSpecificData
,
size_t
fsSpecificDataSize
)
{
unsigned
long
flags
=
0
;
if
(
mountF
lags
==
NULL
||
fsSpecificData
==
NULL
)
{
if
(
f
lags
==
NULL
||
fsSpecificData
==
NULL
)
{
return
0
;
}
...
...
@@ -356,7 +358,7 @@ unsigned long GetMountFlags(char *mountFlags, char *fsSpecificData, size_t fsSpe
// If the item configured in fstab contains flag over than 15,
// @SplitStringExt can handle it and parse them all. but the parse function will drop it.
const
int
maxCount
=
15
;
char
**
flagsVector
=
SplitStringExt
(
mountF
lags
,
","
,
&
flagCount
,
maxCount
);
char
**
flagsVector
=
SplitStringExt
(
f
lags
,
","
,
&
flagCount
,
maxCount
);
if
(
flagsVector
==
NULL
||
flagCount
==
0
)
{
// No flags or something wrong in SplitStringExt,just return.
...
...
interfaces/innerkits/fs_manager/fstab_mount.c
浏览文件 @
8d948a8b
...
...
@@ -13,11 +13,6 @@
* limitations under the License.
*/
#ifdef __cplusplus
#if __cplusplus
extern
"C"
{
#endif
#endif
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
...
...
@@ -33,7 +28,15 @@ extern "C" {
#include "init_utils.h"
#include "securec.h"
#ifdef __cplusplus
#if __cplusplus
extern
"C"
{
#endif
#endif
#define FS_MANAGER_BUFFER_SIZE 512
#define BLOCK_SIZE_BUFFER (64)
bool
IsSupportedFilesystem
(
const
char
*
fsType
)
{
static
const
char
*
supportedFilesystem
[]
=
{
"ext4"
,
"f2fs"
,
NULL
};
...
...
@@ -84,7 +87,6 @@ int DoFormat(const char *devPath, const char *fsType)
return
-
1
;
}
int
ret
=
0
;
#define BLOCK_SIZE_BUFFER (64)
char
blockSizeBuffer
[
BLOCK_SIZE_BUFFER
]
=
{
0
};
if
(
strcmp
(
fsType
,
"ext4"
)
==
0
)
{
const
unsigned
int
blockSize
=
4096
;
...
...
@@ -106,7 +108,6 @@ int DoFormat(const char *devPath, const char *fsType)
char
**
argv
=
(
char
**
)
formatCmds
;
ret
=
ExecCommand
(
argc
,
argv
);
}
#undef BLOCK_SIZE_BUFFER
return
ret
;
}
...
...
@@ -148,7 +149,7 @@ MountStatus GetMountStatusForMountPoint(const char *mp)
}
else
if
(
feof
(
fp
)
>
0
)
{
status
=
MOUNT_UMOUNTED
;
}
fclose
(
fp
);
(
void
)
fclose
(
fp
);
fp
=
NULL
;
return
status
;
}
...
...
@@ -260,7 +261,7 @@ int UmountAllWithFstabFile(const char *fstabFile)
Fstab
*
fstab
=
NULL
;
if
((
fstab
=
ReadFstabFromFile
(
fstabFile
,
false
))
==
NULL
)
{
printf
(
"[fs_manager][error] Read fstab file
\"
%s
\"
failed
\n
"
,
fstabFile
);
return
-
1
;
;
return
-
1
;
}
FstabItem
*
item
=
NULL
;
...
...
interfaces/innerkits/include/fs_manager/fs_manager.h
浏览文件 @
8d948a8b
...
...
@@ -16,12 +16,13 @@
#ifndef STARTUP_FS_MANAGER_H
#define STARTUP_FS_MANAGER_H
#include <stdbool.h>
#ifdef __cplusplus
#if __cplusplus
extern
"C"
{
#endif
#endif
#include <stdbool.h>
/* Fs manager flags definition */
#define FS_MANAGER_CHECK 0x00000001
...
...
@@ -45,7 +46,7 @@ typedef struct FstabItem {
char
*
deviceName
;
// Block device name
char
*
mountPoint
;
// Mount point
char
*
fsType
;
// File system type
char
*
mountOptions
;
// File system mount options. readonly, rw, remount etc.
char
*
mountOptions
;
// File system mount options. readonly, rw, remount etc.
unsigned
int
fsManagerFlags
;
// flags defined by fs manager.
struct
FstabItem
*
next
;
}
FstabItem
;
...
...
@@ -65,7 +66,7 @@ int MountOneItem(FstabItem *item);
MountStatus
GetMountStatusForMountPoint
(
const
char
*
mp
);
int
MountAllWithFstabFile
(
const
char
*
file
,
bool
required
);
int
UmountAllWithFstabFile
(
const
char
*
file
);
unsigned
long
GetMountFlags
(
char
*
mountF
lags
,
char
*
fsSpecificFlags
,
size_t
fsSpecificFlagSize
);
unsigned
long
GetMountFlags
(
char
*
f
lags
,
char
*
fsSpecificFlags
,
size_t
fsSpecificFlagSize
);
#ifdef __cplusplus
#if __cplusplus
}
...
...
services/include/switch_root.h
浏览文件 @
8d948a8b
...
...
@@ -13,7 +13,9 @@
* limitations under the License.
*/
#ifndef INIT_SWITCH_ROOT_H
#define INIT_SWITCH_ROOT_H
int
SwitchRoot
(
const
char
*
newRoot
);
#endif // INIT_SWITCH_ROOT_H
\ No newline at end of file
#ifndef INIT_SWITCH_ROOT_H
#define INIT_SWITCH_ROOT_H
int
SwitchRoot
(
const
char
*
newRoot
);
#endif // INIT_SWITCH_ROOT_H
\ No newline at end of file
services/init/lite/init.c
浏览文件 @
8d948a8b
...
...
@@ -37,7 +37,7 @@ void SystemInit(void)
void
LogInit
(
void
)
{
return
;
}
void
SystemPrepare
(
void
)
...
...
services/init/lite/init_cmds.c
浏览文件 @
8d948a8b
...
...
@@ -12,11 +12,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include "init_cmds.h"
#include <stdlib.h>
#include <string.h>
#include "init.h"
#include "init_cmds.h"
#include "init_log.h"
#include "init_utils.h"
#include "securec.h"
...
...
services/init/main.c
浏览文件 @
8d948a8b
...
...
@@ -20,6 +20,7 @@ static const pid_t INIT_PROCESS_PID = 1;
int
main
(
int
argc
,
char
*
const
argv
[])
{
int
isSecondStage
=
0
;
// Number of command line parameters is 2
if
(
argc
==
2
&&
(
strcmp
(
argv
[
1
],
"--second-stage"
)
==
0
))
{
isSecondStage
=
1
;
}
...
...
services/init/standard/init.c
浏览文件 @
8d948a8b
...
...
@@ -91,7 +91,7 @@ static void StartInitSecondStage(void)
char
*
const
args
[]
=
{
"/bin/init"
,
"--second-stage"
,
NULL
,
NULL
,
};
if
(
execv
(
"/bin/init"
,
args
)
!=
0
)
{
INIT_LOGE
(
"Failed to exec
\"
/bin/init
\"
, err = %d"
,
errno
);
...
...
services/init/standard/init_cmds.c
浏览文件 @
8d948a8b
...
...
@@ -32,13 +32,13 @@
#include <sys/wait.h>
#include <unistd.h>
#include "fs_manager/fs_manager.h"
#include "init.h"
#include "init_jobs.h"
#include "init_log.h"
#include "init_param.h"
#include "init_service_manager.h"
#include "init_utils.h"
#include "fs_manager/fs_manager.h"
#include "securec.h"
int
GetParamValue
(
const
char
*
symValue
,
unsigned
int
symLen
,
char
*
paramValue
,
unsigned
int
paramLen
)
...
...
services/init/standard/switch_root.c
浏览文件 @
8d948a8b
...
...
@@ -54,14 +54,15 @@ static void FreeOldRoot(DIR *dir, dev_t dev)
if
(
S_ISDIR
(
st
.
st_mode
))
{
int
fd
=
openat
(
dfd
,
de
->
d_name
,
O_RDONLY
|
O_DIRECTORY
);
isDir
=
true
;
if
(
fd
>=
0
)
{
DIR
*
subDir
=
fdopendir
(
fd
);
if
(
subDir
!=
NULL
)
{
FreeOldRoot
(
subDir
,
dev
);
closedir
(
subDir
);
}
else
{
close
(
fd
);
}
if
(
fd
<
0
)
{
continue
;
}
DIR
*
subDir
=
fdopendir
(
fd
);
if
(
subDir
!=
NULL
)
{
FreeOldRoot
(
subDir
,
dev
);
closedir
(
subDir
);
}
else
{
close
(
fd
);
}
}
}
...
...
services/log/init_log.h
浏览文件 @
8d948a8b
...
...
@@ -20,6 +20,14 @@
#include <string.h>
#include <unistd.h>
#ifdef OHOS_LITE
#include "hilog/log.h"
#else
#ifdef INIT_AGENT
#include "hilog/log.h"
#endif
#endif
#ifdef __cplusplus
#if __cplusplus
extern
"C"
{
...
...
@@ -45,7 +53,6 @@ void SetInitLogLevel(InitLogLevel logLevel);
#endif
#ifdef OHOS_LITE
#include "hilog/log.h"
#undef LOG_DOMAIN
#define LOG_DOMAIN 0xD000719
...
...
@@ -79,7 +86,6 @@ void InitToHiLog(InitLogLevel logLevel, const char *fmt, ...);
#define LABEL "ParamAgent"
#endif
#include "hilog/log.h"
#define PARAM_AGENT_LOG_PATH "/data/init_agent/init_agent.log"
#define STARTUP_LOGD(LABEL, fmt, ...) \
...
...
services/param/adapter/param_libuvadp.c
浏览文件 @
8d948a8b
...
...
@@ -314,7 +314,7 @@ int ParamTimerStart(ParamTaskPtr timer, uint64_t timeout, uint64_t repeat)
return
-
1
;
}
int
ParamServiceStart
()
int
ParamServiceStart
(
void
)
{
if
(
uv_default_loop
()
==
NULL
)
{
return
-
1
;
...
...
services/param/cmd/param_cmd.c
浏览文件 @
8d948a8b
...
...
@@ -112,7 +112,7 @@ static void ExeuteCmdParamRead(int argc, char *argv[], int start)
SystemSetParameter
(
"test.randrom.test.start"
,
"1"
);
char
buffer
[
PARAM_NAME_LEN_MAX
]
=
{
0
};
printf
(
"SystemGetParameter start
\n
"
);
srand
((
unsigned
)
time
(
NULL
));
(
void
)
srand
((
unsigned
)
time
(
NULL
));
while
(
1
)
{
int
wait
=
rand
()
/
READ_DURATION
+
READ_DURATION
;
// 100ms
uint32_t
size
=
PARAM_NAME_LEN_MAX
;
...
...
@@ -170,17 +170,6 @@ int RunParamCommand(int argc, char *argv[])
space
->
securityLabel
->
cred
.
gid
=
testUid
;
}
#endif
if
((
strcmp
(
argv
[
0
],
"./paramset"
)
==
0
)
||
(
strcmp
(
argv
[
0
],
"paramset"
)
==
0
))
{
if
(
argc
==
(
MIN_ARGC
+
1
))
{
ExeuteCmdParamSet
(
argc
,
argv
,
1
);
}
else
{
printf
(
"param set key value
\n
"
);
}
return
0
;
}
else
if
((
strcmp
(
argv
[
0
],
"./paramget"
)
==
0
)
||
(
strcmp
(
argv
[
0
],
"paramget"
)
==
0
))
{
ExeuteCmdParamSet
(
argc
,
argv
,
1
);
return
0
;
}
if
(
argc
<
MIN_ARGC
)
{
printf
(
"usage:
\n
"
);
for
(
size_t
i
=
0
;
i
<
sizeof
(
paramCmds
)
/
sizeof
(
paramCmds
[
0
]);
i
++
)
{
...
...
services/param/include/param_message.h
浏览文件 @
8d948a8b
...
...
@@ -104,7 +104,7 @@ typedef struct {
}
ParamStreamInfo
;
int
ParamServiceStop
(
void
);
int
ParamServiceStart
();
int
ParamServiceStart
(
void
);
int
ParamTaskClose
(
ParamTaskPtr
stream
);
int
ParamServerCreate
(
ParamTaskPtr
*
server
,
const
ParamStreamInfo
*
info
);
...
...
services/param/trigger/trigger_processor.c
浏览文件 @
8d948a8b
...
...
@@ -43,7 +43,7 @@ static void AddTestTrigger(const TriggerWorkSpace *workSpace)
static
void
TestTimerCallback
(
ParamTaskPtr
timer
,
void
*
context
)
{
srand
((
unsigned
)
time
(
NULL
));
(
void
)
srand
((
unsigned
)
time
(
NULL
));
char
buffer
[
32
]
=
{
0
};
static
int
index
=
0
;
index
++
;
...
...
@@ -54,7 +54,7 @@ static void TestTimerCallback(ParamTaskPtr timer, void *context)
int
count
=
0
;
while
(
count
<
MAX_COUNT
)
{
int
wait
=
rand
()
/
READ_DURATION
+
READ_DURATION
;
// 100ms
sprintf_s
(
buffer
,
sizeof
(
buffer
),
"%u"
,
value
);
(
void
)
sprintf_s
(
buffer
,
sizeof
(
buffer
),
"%u"
,
value
);
PARAM_LOGI
(
"set param name: %s, value %s"
,
TEST_PARAM_NAME
,
buffer
);
SystemWriteParam
(
TEST_PARAM_NAME
,
buffer
);
usleep
(
wait
);
...
...
services/param/watcher/agent/watcher_manager_kits.h
浏览文件 @
8d948a8b
...
...
@@ -73,7 +73,10 @@ private:
DISALLOW_COPY_AND_MOVE
(
DeathRecipient
);
void
OnRemoteDied
(
const
wptr
<
IRemoteObject
>
&
remote
)
final
;
};
sptr
<
IRemoteObject
::
DeathRecipient
>
GetDeathRecipient
()
{
return
deathRecipient_
;
}
sptr
<
IRemoteObject
::
DeathRecipient
>
GetDeathRecipient
()
{
return
deathRecipient_
;
}
private:
void
SetParamWatcher
(
const
std
::
string
&
keyPrefix
,
ParamWatcherKitPtr
watcher
);
...
...
services/utils/init_utils.c
浏览文件 @
8d948a8b
...
...
@@ -173,7 +173,7 @@ char **SplitStringExt(char *buffer, const char *del, int *returnCount, int maxIt
int
count
=
0
;
while
(
p
!=
NULL
)
{
if
(
count
>
itemCounts
-
1
)
{
itemCounts
+=
(
itemCounts
/
2
)
+
1
;
itemCounts
+=
(
itemCounts
/
2
)
+
1
;
// Request to increase the original memory by half.
INIT_LOGD
(
"Too many items,expand size"
);
char
**
expand
=
(
char
**
)(
realloc
(
items
,
sizeof
(
char
*
)
*
itemCounts
));
if
(
expand
==
NULL
)
{
...
...
ueventd/ueventd.c
浏览文件 @
8d948a8b
...
...
@@ -221,32 +221,37 @@ static void DoTrigger(const char *ueventPath, int sockFd)
static
void
Trigger
(
const
char
*
path
,
int
sockFd
)
{
if
(
path
==
NULL
)
{
return
;
}
DIR
*
dir
=
opendir
(
path
);
if
(
dir
!=
NULL
)
{
struct
dirent
*
dirent
=
NULL
;
while
((
dirent
=
readdir
(
dir
))
!=
NULL
)
{
if
(
dirent
->
d_name
[
0
]
==
'.'
)
{
continue
;
}
if
(
dirent
->
d_type
==
DT_DIR
)
{
char
pathBuffer
[
PATH_MAX
];
if
(
snprintf_s
(
pathBuffer
,
PATH_MAX
,
PATH_MAX
-
1
,
"%s/%s"
,
path
,
dirent
->
d_name
)
==
-
1
)
{
continue
;
}
Trigger
(
pathBuffer
,
sockFd
);
}
else
{
if
(
!
strcmp
(
dirent
->
d_name
,
"uevent"
))
{
char
ueventBuffer
[
PATH_MAX
];
if
(
snprintf_s
(
ueventBuffer
,
PATH_MAX
,
PATH_MAX
-
1
,
"%s/%s"
,
path
,
"uevent"
)
==
-
1
)
{
INIT_LOGW
(
"Cannnot build uevent path under %s"
,
path
);
continue
;
}
DoTrigger
(
ueventBuffer
,
sockFd
);
}
}
}
closedir
(
dir
);
if
(
dir
==
NULL
)
{
return
;
}
struct
dirent
*
dirent
=
NULL
;
while
((
dirent
=
readdir
(
dir
))
!=
NULL
)
{
if
(
dirent
->
d_name
[
0
]
==
'.'
)
{
continue
;
}
if
(
dirent
->
d_type
==
DT_DIR
)
{
char
pathBuffer
[
PATH_MAX
];
if
(
snprintf_s
(
pathBuffer
,
PATH_MAX
,
PATH_MAX
-
1
,
"%s/%s"
,
path
,
dirent
->
d_name
)
==
-
1
)
{
continue
;
}
Trigger
(
pathBuffer
,
sockFd
);
}
else
{
if
(
strcmp
(
dirent
->
d_name
,
"uevent"
)
!=
0
)
{
continue
;
}
char
ueventBuffer
[
PATH_MAX
];
if
(
snprintf_s
(
ueventBuffer
,
PATH_MAX
,
PATH_MAX
-
1
,
"%s/%s"
,
path
,
"uevent"
)
==
-
1
)
{
INIT_LOGW
(
"Cannnot build uevent path under %s"
,
path
);
continue
;
}
DoTrigger
(
ueventBuffer
,
sockFd
);
}
}
closedir
(
dir
);
}
static
void
RetriggerUevent
(
int
sockFd
)
...
...
ueventd/ueventd_device_handler.c
浏览文件 @
8d948a8b
...
...
@@ -304,7 +304,7 @@ static const char *GetDeviceName(char *sysPath, const char *deviceName)
}
if
(
deviceName
!=
NULL
&&
deviceName
[
0
]
!=
'\0'
)
{
// if device name reported by kernel includes '/', skip it.
//
TODO:
use entire device name reported by kernel
// use entire device name reported by kernel
devName
=
basename
((
char
*
)
deviceName
);
char
*
p
=
strrchr
(
deviceName
,
'/'
);
if
(
p
!=
NULL
)
{
// device name includes slash
...
...
ueventd/ueventd_firmware_handler.c
浏览文件 @
8d948a8b
...
...
@@ -13,17 +13,17 @@
* limitations under the License.
*/
#include "ueventd_firmware_handler.h"
#include <errno.h>
#include <stdlib.h>
#include <string.h>
#include "ueventd_firmware_handler.h"
#include "ueventd.h"
#define INIT_LOG_TAG "ueventd"
#include "init_log.h"
void
HandleFimwareDeviceEvent
(
const
struct
Uevent
*
uevent
)
{
// TODO, implement it later.
INIT_LOGI
(
"Firmware handler not implemented yet."
);
}
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录