提交 5433527c 编写于 作者: X xionglei6

modify: ueventd poll a moment by itself

Signed-off-by: Nxionglei6 <xionglei6@huawei.com>
上级 834dfaee
......@@ -41,23 +41,6 @@ int main(int argc, char **argv)
if (access(UEVENTD_FLAG, F_OK)) {
INIT_LOGI("ueventd first start to trigger");
RetriggerUevent(ueventSockFd, NULL, 0); // Not require boot devices
struct pollfd pfd = {};
pfd.events = POLLIN;
pfd.fd = ueventSockFd;
while (1) {
pfd.revents = 0;
ret = poll(&pfd, 1, UEVENTD_POLL_TIME);
if (ret == 0) {
break;
} else if (ret < 0) {
INIT_LOGE("Failed to poll ueventd socket!");
return -1;
}
if (pfd.revents & POLLIN) {
ProcessUevent(ueventSockFd, NULL, 0); // Not require boot devices
}
}
int fd = open(UEVENTD_FLAG, O_RDWR | O_CREAT, S_IRUSR | S_IWUSR);
if (fd < 0) {
INIT_LOGE("Failed to create ueventd flag!");
......@@ -68,5 +51,22 @@ int main(int argc, char **argv)
INIT_LOGI("ueventd start to process uevent message");
ProcessUevent(ueventSockFd, NULL, 0); // Not require boot devices
}
struct pollfd pfd = {};
pfd.events = POLLIN;
pfd.fd = ueventSockFd;
while (1) {
pfd.revents = 0;
ret = poll(&pfd, 1, UEVENTD_POLL_TIME);
if (ret == 0) {
break;
} else if (ret < 0) {
INIT_LOGE("Failed to poll ueventd socket!");
return -1;
}
if (pfd.revents & POLLIN) {
ProcessUevent(ueventSockFd, NULL, 0); // Not require boot devices
}
}
return 0;
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册