modify uevent

Signed-off-by: zhong_ning <zhong_ning@hoperun.com>
This commit is contained in:
zhong_ning 2021-08-27 22:11:31 +08:00
parent e7454572bb
commit 679b5cc8a3

View File

@ -219,6 +219,8 @@ static void InitUevent(struct Uevent *event)
event->partitionName = "";
event->deviceName = "";
event->partitionNum = -1;
event->major = -1;
event->minor = -1;
}
static inline const char *ParseUeventMessage(const char **buf, const char *name)
@ -607,7 +609,6 @@ static void HandlePlatformDevice(const struct Uevent *event)
static const char *ParseDeviceName(const struct Uevent *uevent, unsigned int len)
{
INIT_CHECK_RETURN_VALUE(uevent->major >= 0 && uevent->minor >= 0, NULL);
INIT_CHECK_RETURN_VALUE(uevent->deviceName != NULL && uevent->deviceName[0] != '\0', NULL);
const char *name = strrchr(uevent->path, '/');
INIT_CHECK_RETURN_VALUE(name != NULL, NULL);