From d40a46861559220de7d4b21e2568bebb334f9edd Mon Sep 17 00:00:00 2001 From: liupeng298 Date: Tue, 5 Aug 2025 02:31:19 +0000 Subject: [PATCH 1/4] update src/common/file_descriptor.cpp. Signed-off-by: liupeng298 --- src/common/file_descriptor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/file_descriptor.cpp b/src/common/file_descriptor.cpp index 84c11da8..c5fde2d0 100644 --- a/src/common/file_descriptor.cpp +++ b/src/common/file_descriptor.cpp @@ -80,7 +80,7 @@ void HdcFileDescriptor::FileIOOnThread(CtxFileIO *ctxIO, int bufSize) bool bFinish = false; bool fetalFinish = false; ssize_t nBytes; -#ifndef HDC_HOST +#if !defined(HDC_HOST) || defined(HOST_OHOS) constexpr int epollSize = 1; int epfd = epoll_create(epollSize); struct epoll_event ev; -- Gitee From 85ab5c9e807e72b97b4fa218d6c83b0b8b28c0fb Mon Sep 17 00:00:00 2001 From: liupeng298 Date: Tue, 5 Aug 2025 02:32:05 +0000 Subject: [PATCH 2/4] update src/common/file_descriptor.cpp. Signed-off-by: liupeng298 --- src/common/file_descriptor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/file_descriptor.cpp b/src/common/file_descriptor.cpp index c5fde2d0..6d58971d 100644 --- a/src/common/file_descriptor.cpp +++ b/src/common/file_descriptor.cpp @@ -101,7 +101,7 @@ void HdcFileDescriptor::FileIOOnThread(CtxFileIO *ctxIO, int bufSize) bFinish = true; break; } -#ifndef HDC_HOST +#if !defined(HDC_HOST) || defined(HOST_OHOS) int rc = epoll_wait(epfd, events, epollSize, SECONDS_TIMEOUT * TIME_BASE); #else struct timeval timeout; -- Gitee From 4de72b9aff8abaf4a6ee435e8d4768ea00472b68 Mon Sep 17 00:00:00 2001 From: liupeng298 Date: Tue, 5 Aug 2025 02:40:11 +0000 Subject: [PATCH 3/4] update src/common/file_descriptor.cpp. Signed-off-by: liupeng298 --- src/common/file_descriptor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/common/file_descriptor.cpp b/src/common/file_descriptor.cpp index 6d58971d..4d070c89 100644 --- a/src/common/file_descriptor.cpp +++ b/src/common/file_descriptor.cpp @@ -125,7 +125,7 @@ void HdcFileDescriptor::FileIOOnThread(CtxFileIO *ctxIO, int bufSize) continue; } nBytes = 0; -#ifndef HDC_HOST +#if !defined(HDC_HOST) || defined(HOST_OHOS) uint32_t event = events[0].events; if ((event & EPOLLIN) && (thisClass->fdIO > 0)) { nBytes = read(thisClass->fdIO, buf, bufSize); @@ -180,7 +180,7 @@ void HdcFileDescriptor::FileIOOnThread(CtxFileIO *ctxIO, int bufSize) } #endif } -#ifndef HDC_HOST +#if !defined(HDC_HOST) || defined(HOST_OHOS) if ((thisClass->fdIO > 0) && (epoll_ctl(epfd, EPOLL_CTL_DEL, thisClass->fdIO, nullptr) == -1)) { WRITE_LOG(LOG_INFO, "EPOLL_CTL_DEL fail fd:%d epfd:%d errno:%d", thisClass->fdIO, epfd, errno); -- Gitee From 2348162fc89dec70ea83070ffc964e9ac1a4528b Mon Sep 17 00:00:00 2001 From: liupeng298 Date: Tue, 5 Aug 2025 07:46:47 +0000 Subject: [PATCH 4/4] update src/common/file_descriptor.cpp. Signed-off-by: liupeng298 --- src/common/file_descriptor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/file_descriptor.cpp b/src/common/file_descriptor.cpp index 4d070c89..24c18f68 100644 --- a/src/common/file_descriptor.cpp +++ b/src/common/file_descriptor.cpp @@ -13,7 +13,7 @@ * limitations under the License. */ #include "file_descriptor.h" -#ifndef HDC_HOST +#if !defined(HDC_HOST) || defined(HOST_OHOS) #include #endif -- Gitee