mirror of
https://gitee.com/openharmony/hiviewdfx_hitrace
synced 2024-11-23 07:49:43 +00:00
fix: epoll_wait函数返回错误EINTR后再次执行该方法
Signed-off-by: jiangwei <jiangwei214@h-partners.com>
This commit is contained in:
parent
468e3cfab1
commit
d010361a0c
@ -1042,7 +1042,10 @@ bool EpollWaitforChildProcess(pid_t &pid, int &pipefd)
|
||||
|
||||
struct epoll_event events[1];
|
||||
constexpr int waitTimeoutMs = 10000; // 10000ms = 10s
|
||||
int numEvents = epoll_wait(epollfd, events, 1, waitTimeoutMs);
|
||||
int numEvents = 0;
|
||||
do {
|
||||
numEvents = epoll_wait(epollfd, events, 1, waitTimeoutMs);
|
||||
} while (numEvents == -1 && errno == EINTR);
|
||||
if (numEvents == -1) {
|
||||
HILOG_ERROR(LOG_CORE, "epoll_wait error, error: (%{public}s).", strerror(errno));
|
||||
close(pipefd);
|
||||
|
Loading…
Reference in New Issue
Block a user